method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
b80beb8c-0ebe-4cab-a030-df55b7d35923 | 1 | public boolean levelUp() {
if(this.experience >= this.cap)
{
this.setCap(this.cap * 2);
this.setLevel(this.level++);
addStats();
return true;
}
return false;
} |
94c0ae5f-fcc1-468b-a97a-baa50bbfe3d5 | 2 | protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
BookService bookService = (BookService) getServletContext().getAttribute("bookService");//呼叫service
int booksCount = bookService.getBooksCount();//... |
0785ba65-9655-4b47-84b0-8c54b42df311 | 1 | public void update(long deltaMs) {
if(Application.get().getLogic().getActor(weaponID) == null) {
weaponID = NO_WEAPON;
}
} |
9b16d129-9be1-4922-96e9-a9a209d7e4bf | 0 | @Test
public void testCalculateRewardPoints() {
this.card2.makePurchase(100);
this.card2.makePurchase(100);
this.card2.makePurchase(100);
this.card2.makePurchase(100);
assertEquals(400, this.card2.calculateRewardPoints());
} |
d5c0d4fd-dff4-4cc0-b762-a3905ed35377 | 0 | public String getMimeType() {
return mimeType;
} |
1e6db459-4a7d-4bf4-81d2-3b2fd67be648 | 2 | public static String[] searchEmployee(Integer ID) {
Database db = dbconnect();
String [] Array = null;
try {
String query = ("SELECT * FROM employee WHERE EID = ? AND bDeleted = 0");
db.prepare(query);
db.bind_param(1, ID.toString());
ResultSet rs = db.execut... |
7be2ef91-61c4-4cbd-92ab-6dff95b3e0d1 | 7 | public void render(boolean[] displaySegments){
GL11.glTranslatef(pos.x(), pos.y(), 0);
texture.bind();
if(displaySegments[0]){
GL11.glTranslatef(0, -height/2, 0);
renderSegment(width*0.6f, height*0.125f);
GL11.glTranslatef(0, height/2, 0);
}
if(displaySegments[1]){
GL11.glTranslatef(width/2, -heig... |
40ef60ab-ed9b-4b5b-888b-b4bc60c7c4b9 | 7 | public static void run(Bot bot, String res, String sender, String s) {
if (!sender.matches("(.*)[bB][oO][tT](.*)|(.*)Satoshi[DV]ICE(.*)")) {
int now = (int) System.currentTimeMillis();
int threshold = now - intTime;
intTime = now;
if (threshold < 1200) {
Logger.warn("Flood WARNING!");
//Sys... |
c37d76d5-8fe2-45ea-bd58-bb18df756811 | 5 | @Override
public void initialize(InputSplit arg0, TaskAttemptContext arg1)
throws IOException, InterruptedException {
try {
reader = new PartitionReader(new OptimusConfiguration(((TRANSInputSplit)arg0).getConfDir()));
} catch (WrongArgumentException e) {
// TODO Auto-generated catch block
e.printStackT... |
a9cb996f-b0db-4b77-8ac4-b52bf380c5d1 | 0 | private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
modificarFrame.setVisible(false);
}//GEN-LAST:event_jButton2ActionPerformed |
038b31b1-9550-4501-9a1c-80e21fa45f5c | 0 | public static void main(String[] args) {
// 从控制台输入数字
System.out.println("请输入你要处理的数字:");
Scanner input = new Scanner(System.in);
Long testObject = input.nextLong();
Handler handler = new HandlerImplOne();
String info = handler.dealWith(testObject);
System.out.println(info);
} |
a916b2ba-d49f-462c-bb31-04b7f995e124 | 0 | public void cancelEdit() {
super.cancelEdit();
setTimeSpinners();
} |
379345bb-5e66-4f3e-b158-1af1a4f41f27 | 0 | public Tag getTag(Component component) {
return (Tag) componentTags.get(component);
} |
b9224668-6d26-408f-87fe-a0b2de03dc23 | 4 | @Override
public void run() {
try {
System.out.println("run it!");
input = getBufferedReader(client.getInputStream());
output = getPrintStream(client.getOutputStream());
System.out.println("Stream it!");
hello(user.getUsername(), Server.GLOBAL_SUPPORTS, "0.1");
System.out.println("Hands... |
8f484d57-ea8b-4c34-8f81-a709d5b6789d | 2 | public void initCodeRedSchedule() {
codeRedSchedule.clear();
for (Match match : matches){
if(match.searchFor(2771)){
codeRedSchedule.add(match);
}
}
} |
bb9fee24-f58c-40b8-948e-9da2c039e90c | 0 | public RandomSkipIterator(IRandomAccessor2<T> accessor, int count)
{
this._accessor = accessor;
this._pos = count;
} |
29e3c817-4bc1-4a44-9656-b5f031bee246 | 2 | private static HashSet<Class<?>> getSupportedTypes()
{
HashSet<Class<?>> set = new HashSet<>();
set.add(String.class);
set.add(Boolean.class);
set.add(Integer.class);
set.add(Double.class);
set.add(Byte.class);
set.add(Short.class);
set.add(Long.class... |
2979a7e7-4cff-4ac0-9125-627188eb04ad | 3 | public static void square(double x, double y, double r) {
if (r < 0) {
throw new IllegalArgumentException("square side length must be nonnegative");
}
double xs = scaleX(x);
double ys = scaleY(y);
double ws = factorX(2 * r);
double hs = factorY(2 * r);
... |
e5be30dd-751f-4dfb-9aac-ec7d8ff63db9 | 4 | private static void bilinear(float p) {
ImageData imageData = original.getImageData();
int[][] two1 = new int[imageData.height][imageData.width];
for (int i = 0; i < imageData.height; i++) {
for (int j = 0; j < imageData.width; j++) {
two1[i][j] = imageData.getPixel(j, i);
}
}
int[] one1 = ImageUt... |
155cf5e9-1d0c-4056-a843-629bb8bd0544 | 2 | @Override
public RegisterUserResponse registerUser(String username, String password) {
ArrayList<Pair<String,String>> requestHeaders = new ArrayList<Pair<String,String>>();
requestHeaders.add(new Pair<String,String>(CONTENT_TYPE_STR, APP_JSON_STR));
UserRequest loginRequest = new UserRequest(username, password);... |
f140e124-9746-4e43-a64a-9c1dd568edfe | 4 | private void removeIcon(String icon) {
for (Pair<String, Integer> pair : icons) {
if (pair.getLeft().equals(icon)) {
icons.remove(pair);
break;
}
}
for (Channel channel : getChannels()) {
String remove = PacketCreator.removeIcon(channel.getName(), name,
icon);
for (Client target : chann... |
39e8c57b-0b45-43fa-93ae-752f981ebf87 | 8 | private boolean createTable() {
Connection conn = null;
Statement s = null;
ResultSet rs = null;
try {
conn = getConnection();
s = conn.createStatement();
s.executeUpdate(sqlMakeTable);
try {
// make sure `uuid` column exists, otherwise table is outdated and needs ... |
fcc9afdc-0003-4e61-b086-25f4c89b5ebb | 5 | private boolean purchase(ShopItem item, int amount)
throws InterruptedException {
final int oldID = item.getID();
validate(item.getSlot());
if (oldID != item.getID())
throw new RuntimeException("Inconsistent item! Required: " + oldID + ", but found: " + item.getID());
else if (item.getAmount() <= 0)
re... |
37e19b6e-025e-4971-950b-839a2ad6d61b | 8 | public static synchronized String[] getTwitchStreamList() {
//TODO ensure these streams are loaded up via text file
twitchStream.areStreamsUp();
ArrayList<String> streamList = TwitchStream.getStreamList(); //ids for stream
ArrayList<String> streamName = TwitchStream.getStreamName(); //n... |
b28abffa-6ef3-4dff-a56e-3e8b20991364 | 4 | private static void typeCheckCodeGenerator( SemanticAction node, String leftOrRight )
{
switch ( node.getType() )
{
case DEFINITION:
if( !node.getName().equals("main") ){
}
break;
case PRINT:
break;
case INTEGER:
break;
}
... |
0f9249c2-c13c-4a61-b600-c471a89e8e26 | 0 | public String getColumnName() {
return name;
} |
162d543b-2aeb-4f54-8761-8279e31b8c4f | 7 | public void RSAEncrypt(int length) throws RdesktopException {
byte[] inr = new byte[length];
// int outlength = 0;
BigInteger mod = null;
BigInteger exp = null;
BigInteger x = null;
this.reverse(this.exponent);
this.reverse(this.modulus);
System.arraycopy(this.client_random, 0, inr, 0, length);
this.... |
63939d01-ed44-4ae4-ac8a-3fbc3d5895a9 | 0 | public void setSecond(T newValue) { second = newValue; } |
56671f2a-cb4e-4b79-b532-2328103c38ea | 5 | static final synchronized void method1142(byte i) {
anInt1913++;
if (Class168.anObject2256 == null) {
try {
Class var_class
= Class.forName("java.lang.management.ManagementFactory");
Method method
= var_class.getDeclaredMethod("getPlatformMBeanServer",
null);
Object object = method.invo... |
c8c2199f-9bcc-4992-894e-0f175eda786f | 4 | @Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (! (obj instanceof MessageContainer)) {
return false;
}
MessageContainer other = (MessageContainer) obj;
if (messageID != other.messageID) {
return false;
}
return... |
20190c9f-20e2-4240-a09c-03351eb8718e | 1 | private static int decodeConnectionId(byte connectionId) {
return (int) (connectionId < 0 ? connectionId - 2*Byte.MIN_VALUE : connectionId);
} |
a84cb0e3-6545-4853-877b-5235781f6934 | 6 | public char charAt(int index) throws IndexOutOfBoundsException, NullPointerException {
if(index < 0 || index > this.length() - 1) {
throw new IndexOutOfBoundsException();
}
if(this.head == null) {
throw new NullPointerException();
}
this.current = this.head;
for(int i = 1; i <= index; i++)... |
f5d93d84-e1b8-4236-bc84-6af3a9cd72fe | 0 | @Override
public void run() {
MailUtil.sendMailSynchron(subject, content, email, force);
} |
c74d33a8-c695-4540-9daf-610bba6a0248 | 4 | private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
try {
String empleado = JOptionPane.showInputDialog("Confirmar");
String sql = "INSERT INTO ventas(Empleados_idEmplead... |
6372ff6b-d8ca-4abf-9427-6757ca54db8f | 1 | public void usingEntrySet(Map<Integer, String> map){
for(Map.Entry<Integer, String> entry: map.entrySet()){
System.out.println("Key: "+entry.getKey()+" Value: "+entry.getValue());
}
} |
e01fdca7-7e33-489d-9eed-06fd785605d0 | 3 | public void addTile(int tileX, int tileY, int tileType)
{
Tile tile = null;
if(tileType == TileTypes.BASIC_WALL)
{
tile = new TileWall(tileX * Tile.TILE_SIZE, tileY * Tile.TILE_SIZE, true);
}
else if(tileType == TileTypes.PATH)
{
tile = new TilePath(tileX * Tile.TILE_SIZE, tileY * Tile.TILE_SIZE, fal... |
77fb2a4d-5089-453f-b86d-5670cda4a2d6 | 1 | public String getMethodrefClassName(int index) {
MethodrefInfo minfo = (MethodrefInfo)getItem(index);
if (minfo == null)
return null;
else
return getClassInfo(minfo.classIndex);
} |
02f28479-b66f-47a6-a4fb-7440e8903fac | 0 | public Image getImageBytesAndContentTypeById(String id) {
return imageTemplateRepository.getImageBytesAndContentTypeById(id);
} |
741cc5c4-5e42-437c-a9db-7d749d08e1a1 | 1 | public static World GetWorld(String name) {
if (Core.getPlugin().getServer().getWorld(name) == null) {
LoadWorld(name);
}
return Core.getPlugin().getServer().getWorld(name);
} |
adf8b09c-843c-470d-a54d-2a3b79340453 | 4 | @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onSignChange(SignChangeEvent event){
Player player = event.getPlayer();
if(isSignLine(event.getLine(0)))
for(String s : signLines)
if(event.getLine(0).equalsIgnoreCase(s)) {
if(player.hasPermission("bank.sign.place")) {
... |
27a40875-b86b-48fe-b24b-12b7a0bba186 | 8 | private void calculateDimensions( int cWidth, int cHeight )
{
// Calculate chart dimensions
chartWidth = ( cWidth == 0 ? DEFAULT_WIDTH : cWidth );
chartHeight = ( cHeight == 0 ? DEFAULT_HEIGHT : cHeight );
if ( cWidth > 0 ) numPoints = cWidth;
// Padding depends on grid visibility
chart_lpadding = ... |
a433f611-2543-40e6-a660-426e44735dc2 | 9 | public int getDiggingDepth(Item item)
{
if(item==null)
return 1;
switch(item.material()&RawMaterial.MATERIAL_MASK)
{
case RawMaterial.MATERIAL_METAL:
case RawMaterial.MATERIAL_MITHRIL:
case RawMaterial.MATERIAL_WOODEN:
if(item.Name().toLowerCase().indexOf("shovel")>=0)
return 5+item.phyStats().we... |
d21a5c22-f9c9-430b-a06d-7d2c0a37dd24 | 5 | public boolean setField(int maxField, int nodeID, int eventType,
int startTime, int endTime) {
// need to subtract by 1 since array starts at 0.
if (nodeID > 0) {
NODE_ID = nodeID - 1;
} else
throw new IllegalArgumentException("Invalid node id fi... |
64349727-3e48-4083-bc93-92b4ee655c70 | 1 | public UserDao getUserDao(){
if(userDao == null)
userDao = new UserDaoImpl();
return userDao;
} |
e72574c9-ec12-44b4-b1d0-1185e891db46 | 6 | public void goTop()
{
nNode = top;
sRecno = 0;
found = false;
for(;;)
{
goNode();
readPage();
if(left_page>0) nNode=left_page;
else
{
for(;;)
{
if(key_cnt>0 || right_page<0) break;
nNode = right_page;
goNode();
readPage();
}
nKey = 0;
if(LEAF)
... |
b89c4202-5524-4f3d-b39c-fbaa756753d3 | 3 | @Override
protected void resolveCollision(GameContext g, Collidable c, float percent) {
// if (isDead) {
// return;
// }
if (c instanceof DynamicPolygon) {
DynamicPolygon d = (DynamicPolygon)c;
// if (d.isDead) {
// return;
// }
setCollisionPosition(percent);
if (d.vertices != vertices)
r... |
109a72e6-54ec-4a59-8ea0-09b8df6fc442 | 1 | public String toString() {
try {
return this.toJSON().toString(4);
} catch (JSONException e) {
return "Error";
}
} |
626ab57b-b719-4856-ac1a-8c608417d158 | 8 | private static void point_search(finger_print fp) {
// TODO Auto-generated method stub
ArrayList<Integer> lst = new ArrayList<Integer>();
for (Integer fid : fp.feature_map.keySet()) {
if (finger_print.invert_index.containsKey(fid)) {
for (Integer potent : finger_print.invert_index.get(fid)
.keySet()... |
d7da8fd5-d8bb-4802-9939-1b58ab199423 | 4 | private void addHouse(Tile temp, Point position)
{
MapObject obj = new Building(temp, sfap.objSize,
this.TILE_SIZE, position, 0);
if (Collision.noCollision(grid, obj.getStartPos(), obj.getEndPos()))
{
if (!Collision.intersects(obj.getPlace(), gridBoundary))
{
for (int k = position.x; k < position.x... |
6f42370b-ba82-40ec-90a5-50e45c5c90ed | 6 | public boolean contains(Vector vector) {
if(vector.x > max.x || vector.x < min.x || vector.y > max.y || vector.y < min.y) {
return false;
}
Edge ray = new Edge(vector, new Vector(min.x - 1, min.y - 1));
int intersections = 0;
for(Edge edge : edges) {
if(ray.intersects(edge, true)) {
intersections++;... |
694388fa-f8c6-4784-b6e9-d8fe2ed61247 | 2 | @Override
public int matches( char[] sequenceA, int indexA, char[] sequenceB, int indexB, int count )
{
for (int i = 0; i < count; i++)
{
char a = sequenceA[indexA + i];
char b = sequenceB[indexB + i];
if (Character.toLowerCase( a ) != Character.toLowerCase( b ))
{... |
a4d22559-ac34-41b8-a7a9-672b3618bc5c | 6 | public static ArrayList<IStudent> sort(ArrayList<IStudent> students) throws IllegalArgumentException {
ArrayList<IStudent> temp1 = new ArrayList<>();
ArrayList<IStudent> temp2 = new ArrayList<>();
ArrayList<IStudent> temp3 = new ArrayList<>();
ArrayList<IStudent> temp4 = new ArrayList<>(... |
c30844cd-8ddc-4069-b3a3-78d3502d88f3 | 5 | public static String writeKarnaughMap(KarnaughTable kmap, int nbrVars) {
int width = nbrVars * 50;
String s = "";
s += "<div id=\"cent\" align=\"center\">";
s += "<h3 class =\"subsubTitle2\">"
+ Tools.getLocalizedString("KARNAUGH_MAP.Name") + ":" + "</h3>";
s += "<table width=\"" + width + "\"><tr>";
... |
923fed4d-b305-4f78-bd39-5d0999ee29e7 | 9 | private Mob(Map<String, Object> cfg)
{
super.setMapCfg(cfg);
spawnChance = getAndSet("SpawnChance", 1);
int maxAlive = getAndSet("MaxAlive", 0);
int mobCooldown = getAndSet("MobCooldown", 60) * 1000;
boolean enforceAllRemovalConditions = getAndSet("EnforceAllCooldownConditions", false);
if (maxAlive ... |
dc54667b-8a62-43ff-a6ea-fa7a978950d3 | 1 | public int exprHashCode() {
int v = 5 + kind ^ receiver.exprHashCode();
for (int i = 0; i < params.length; i++) {
v ^= params[i].exprHashCode();
}
return v;
} |
dae47a53-4768-4dbb-a60c-c8ddfce5e120 | 3 | public DirtBasedAgentState(MovementAction action, Sensor sensor) {
super(action);
dist = new int [Direction.values().length];
type = new int [Direction.values().length];
for (String s : sensor.getSenseKeys()){
String tag[] = s.split("-");
Direction d = Direction.valueOf(tag[0]);
if (s.contains(DirtB... |
b31171c6-1d21-4ecb-ab18-515230de99fe | 8 | public static ArtNetObject decodeArtNetPacket(final byte[] packet, final InetAddress ip) {
// The ArtNetPacket.
final ArtNetObject artNetObject = null;
// Set generals infos
final String hexaBrut = byteArrayToHex(packet);
final String id = new String(packet, 0, 7);
// Extract OpCode
int opCode = ((pa... |
d2046fa5-1a03-4d7f-88e4-861f0a027b01 | 9 | public static int[][] generateSpiralMatrix(int n) {
if(n < 1) {
return null;
}
int[][] input = new int[n][n];
int count = 1;
int rowStart = 0;
int rowEnd = n-1;
int columnStart = 0;
int columnEnd = n-1;
while(rowStart<= rowEnd && col... |
2e434675-3e0a-42d5-8241-40febae265a9 | 8 | public void setSecurity(Security value)
{
security = value;
String userName = security.getUserName();
String passwordText = security.getPassword();
String account = security.getAccount();
if (userName != null && userName.trim().length() != 0)
{
// If no pa... |
3c9e8d72-dc97-4972-980f-f2cb5ec833a7 | 2 | public static void loadFromFile() throws Exception{
String filename = "Girl.bin";
File file = new File(filename);
FileInputStream fis = new FileInputStream(file);
ObjectInputStream ois = new ObjectInputStream(fis);
try{
Object temp = ois.readObject();
if(temp.getClass().getName().equals("Girl")){
he... |
dc606593-d388-4fb5-b04d-d8076361453a | 6 | public void pintarTableroVirtual() {
int aleatorio;
Random pitopitogorgorito=new Random();
for (int i = matrizVirtual.length-1; i >= 0; i--) {
System.out.println(" _______________________________________");
System.out.print(i + " |");
for (int j = 0; j < matrizVirtual[0].length; j++) {
switch (matr... |
9144bcc6-d52a-44ea-841d-7054270ab579 | 1 | private String chooseFile(String mode)
{
JFileChooser chooser = getFileChooser(mode);
if (chooser.showDialog(org.analyse.main.Main.analyseFrame, null) == JFileChooser.APPROVE_OPTION) {
return chooser.getSelectedFile().getAbsolutePath();
}
return null;
} |
14356e23-30df-4d26-aeb3-7e75511ea5e3 | 4 | public boolean contains(final Location location) {
return world.equalsIgnoreCase(location.getWorld().getName()) && location.getX() <= xMax && location.getZ() <= zMax && location.getX() >= xMin && location.getZ() >= zMin;
} |
7353ff2d-0326-4aa8-b144-a470f40ab098 | 8 | protected void layout(Composite composite, boolean flushCache) {
Rectangle rect = composite.getClientArea();
Control[] children = composite.getChildren();
int count = children.length;
if (count == 0)
return;
int width = rect.width - marginWidth * 2;
int height = rect.height - marginHeight * 2;
if (type... |
73f68352-0535-4a9f-87ae-eadda1d93602 | 2 | public final Hashtable<Integer,Integer> distributionOnl() {
final Hashtable<Integer,Integer> onld = new Hashtable<Integer,Integer>();
for (int m=0; m<this.m; m++) {
final Integer key = onl[m].size();
Integer value = onld.get(key);
if (value==null) onld.put(key, value);
else value++;
}
return onld;
... |
d915318f-7f0c-4736-9135-cf7dad6032a2 | 8 | public void pixel_frontiere_proche(int i, int j, Image image){
//Si le pixel n'est pas en haut
if(i != 0){
if(image.getPixel(i - 1, j).getColor().equals(Color.BLACK)){
image.getPixel(i, j).setFrontiereProche(true);
}
}
//Si le pixel n'est pas en ba... |
f48c9f3b-12f0-4211-8dbb-b6b6c420ed8e | 6 | private void cancelKeys() {
if (cancelQueue.isEmpty())
return;
Selector selector = this.selector;
for (;;) {
CancellationRequest request = cancelQueue.poll();
if (request == null) {
break;
}
DatagramChannel ch = chann... |
390fb144-1c66-415d-8eb9-ccefef968dda | 9 | void dfs(String[] board, int i, int j, int color){
int[] x = {-1,-1,0,1,1,0};
int[] y = {0,1,1,0,-1,-1};
int n = board.length;
colors[i][j] = color;
for(int e=0; e<6; e++){
int u = i+x[e];
int v = j+y[e];
if(u>=0 && u<n && v>=0 && v<n && board... |
56cd2e0a-c6f9-4d1d-a3c3-841eec0f04eb | 7 | public void write(Writer writer)
throws IOException
{
if (this.name == null) {
this.writeEncoded(writer, this.contents);
return;
}
writer.write('<');
writer.write(this.name);
if (! this.attributes.isEmpty()) {
Iterator iter = this.a... |
9f845515-a98c-4ec8-af4f-a7548533a4c9 | 6 | private String getRemainingTime(long seconds) {
// This is only an approximation - it doesn't count actual calendar months
long minutes = seconds / 60;
long hours = minutes / 60;
long days = hours / 24;
long months = days / 30;
long years = days / 365;
boolean oneDayLeft = days == 0;
boolean oneHourL... |
dccf5f39-ee44-4ec7-8023-cebab159358e | 2 | public CommandWords() {
commands = new HashMap<String, String>();
captureGroups = new HashMap<String, int[]>();
HashMap<String, String> commandFile = KvReader.readFile("help.kv");
for(Entry<String, String> e : commandFile.entrySet()){
String eKey = e.getKey();
if(... |
90dfa4e3-8ef0-4aed-bef9-774bb9701871 | 2 | public boolean formExists(int formId) {
try {
String q = "select count(*) from form where formid = ?;";
PreparedStatement st = conn.prepareStatement(q);
st.setInt(1, formId);
ResultSet rs = st.executeQuery();
conn.commit();
rs.next();
... |
0515cc90-5b6c-4add-b031-ea78bbe9badd | 9 | public void payInstallment(Payment payment) throws Exception {
if (payment == null) {
throw new Exception("Payment tidak boleh null.");
}
if (payment.getPaymentStatus() == null) {
throw new Exception("Payment status tidak boleh null.");
}
if (!payment.getPaymentStatus().equals('N')) {
throw new Exc... |
da3cc721-0e48-43e7-960d-70b68cc64c92 | 3 | final public void Additive_operator() throws ParseException {
/*@bgen(jjtree) Additive_operator */
SimpleNode jjtn000 = new SimpleNode(JJTADDITIVE_OPERATOR);
boolean jjtc000 = true;
jjtree.openNodeScope(jjtn000);
jjtn000.jjtSetFirstToken(getToken(1));
try {
if (jj_2_60(3)) {
... |
091acf10-72cd-4fc2-9a9d-a9471b4c44ef | 0 | public ArrowNontransitionTool(AutomatonPane view, AutomatonDrawer drawer) {
super(view, drawer);
} |
d7ef4167-ef30-4e1a-8be4-86ae06d461a0 | 0 | public final void drawArrow(Graphics g) {
int center = getWidth() >> 1;
g.setColor(Color.black);
g.drawLine(center, 0, center, ARROW_LENGTH);
g.drawLine(center, ARROW_LENGTH, center - 10, ARROW_LENGTH - 10);
g.drawLine(center, ARROW_LENGTH, center + 10, ARROW_LENGTH - 10);
g.translate(0, ARROW_LENGTH)... |
77fabaa0-0922-4b3a-a7a1-44b825e40693 | 0 | public String getTelefon() {
return telefon;
} |
874e3098-0ad6-4349-a2c8-e9d2a84a05bf | 7 | @Override
public V opposite(V vertex, E edge) {
// Check that both the edge and vertex are in our graph.
if (vertex == null || edge == null || !vertices.contains(vertex)
|| !edges.contains(edge)) {
return null;
}
// Get the vertices for the edge.
Set<V> vertices = edgesToVertices.get(edge);
if (v... |
43879374-fced-4061-8529-3de0a9eb8652 | 8 | public void save() {
try {
if (getSize() == 0) {
if ((file.exists()) && (!file.delete())) {
throw new DataBaseException("Cannot delete a file!");
}
deletePath();
} else {
createPath();
if ... |
0af0a6f7-bebd-4f4b-b21e-aece5a4ff8df | 1 | public static DateConverter getInstance() {
DateConverter dateConverter = SHARED_INSTANCE;
if (dateConverter == null) {
dateConverter = new DateConverter();
}
return dateConverter;
} |
f1c78ec2-a541-4f40-a711-e71ab93ed292 | 9 | public static Stella_Object accessXmlExpressionIteratorSlotValue(XmlExpressionIterator self, Symbol slotname, Stella_Object value, boolean setvalueP) {
if (slotname == Stella.SYM_STELLA_REGION_TAG) {
if (setvalueP) {
self.regionTag = ((Cons)(value));
}
else {
value = self.regionTag... |
e00aecb1-395b-485c-9713-0524f3a318cb | 1 | private Object getKey(Object key)
{
if(key instanceof CaseInsensitiveString)
{
return caseMap.get(((CaseInsensitiveString)key).lcString());
}
return key;
} |
556ddb73-12e6-4083-8a69-c882ba8f93e7 | 1 | public static void main(String[] args) throws Exception {
ApplicationContext ctx = new ClassPathXmlApplicationContext(
"context/jdbcContext.xml");
// dataSourceはSpringで作成。
DataSource source = (DataSource) ctx.getBean("dataSource");
Connection con = source.getConnection();
Statement stat = con.createState... |
537afad9-3663-4b30-8ddb-a8eff909686b | 8 | public boolean isPolymorphic(int site) {
if (sg.size()==0)
return false;
char base = sg.get(0).at(site);
int seqNum = 0;
while (seqNum < sg.size() && charIsGap(base) ) {
base = sg.get(seqNum).at(site);
seqNum++;
}
//Every base is a gap in this column, I guess we return false here
if (seqNum... |
c0bceef6-7a34-4008-86a8-672fde6a4c58 | 7 | private boolean RevisarDatosEmpleado(Empleado entrada_Empleado){
boolean DatosFormularioEmpleadoCorrectos = true;
boolean DatosFormularioEmpleadoIncorrectos = false;
if( EsNombreCompletoCorrecto(entrada_Empleado.ObtenerNombreCompleto())
&& EsUsuarioCorrecto(entrada_Empleado.Obtener... |
0954cf5d-383d-45ae-b871-b93c0bd61fbf | 2 | private Mesh loadMesh(String fileName) {
String[] splitArray = fileName.split("\\.");
String ext = splitArray[splitArray.length - 1];
if (!ext.equals("obj")) {
System.err.println("Error: File format not supported for mesh data: " + ext);
new Exception().printStackTrace()... |
04565828-c7ab-4688-b6c9-c1fc0c81a896 | 3 | public static boolean check(Point[] a) {
double k;
double z;
if (a.length < 1) return true;
k = ((double)a[0].x - (double)a[1].x) / ((double)a[0].y - (double)a[1].y);
for (int i = 1; i < a.length; i++) {
z = ((double)a[0].x - (double)a[i].y) / ((double)a[0].y - (d... |
17193703-b017-4235-bcd7-b6db97b5d5b0 | 4 | private void setupRandPartA() throws IOException {
if (this.su_i2 <= this.last) {
this.su_chPrev = this.su_ch2;
int su_ch2Shadow = this.data.ll8[this.su_tPos] & 0xff;
this.su_tPos = this.data.tt[this.su_tPos];
if (this.su_rNToGo == 0) {
this.su_rNT... |
813d9551-e6f8-4f49-9ebb-bbf53e744a5d | 3 | public static ItemObject getItemObjectByName( String itemName ) {
ItemObject result = null;
Iterator<ItemObject> iterItems;
ItemObject itemObject;
iterItems = _itemList.iterator();
while ( iterItems.hasNext() ) {
itemObject = (ItemObject) iterItems.next();
if ( itemObject != null ) {... |
dbfbc51b-f0f7-40a7-bf6a-2d6ed585c4d2 | 8 | public void paint(Graphics g){
this.setDoubleBuffered(true);
Insets in = getInsets();
g.translate(in.left, in.top);
//int[][] gameboard = logic.getGameBoard();
int cols = gameBoard.length;
int rows = gameBoard[0].length;
for (int c = 0; c < cols; c++){
for (int r = 0; r < r... |
129076c3-da65-4232-acc4-6ba30d21c3f7 | 0 | @Basic
@Column(name = "comment")
public String getComment() {
return comment;
} |
0c048e87-aea7-41cd-9360-5d3d936800ba | 0 | public StringPot(int channelNum) {
_channel = new AnalogChannel(channelNum);
} |
b31cbfb3-6086-40ed-8b1f-ad07b4486cc3 | 4 | public static Set<Integer> findSetIntersection(int[] array1, int[] array2) {
Set<Integer> set1 = new HashSet<Integer>();
Set<Integer> intersectionSet = new HashSet<Integer>();
for (int i : array1) {
set1.add(i);
}
for (int i : array2) {
if (set1.contains... |
358bd8bd-3a54-4e37-8bde-28cd8276b5e3 | 4 | private void setMessage(WizardStatus level, String message) {
messageLabel.setText("<html>" + message + "</html>"); //$NON-NLS-1$ //$NON-NLS-2$
Icon icon = null;
switch (level) {
case OK:
icon = ResourcesLoader.getIcon("balloon", 24); //$NON-NLS-1$
content.setBorderColor(Color.BLACK);
break;
case INF... |
0a13dbb6-8cc1-4c6d-a736-99834b807471 | 4 | @Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Cashflow other = (Cashflow) obj;
return Math.abs(amount - other.amount) <= ACCURACY && date == other.date;
} |
1ae6983b-3254-4a6b-87ea-c636f130da93 | 1 | public void run( boolean outputContent ) throws Exception {
Configuration conf = new Configuration();
String output = Constants.WORD_OUTPUT_DIR;
FileSystem fileSystem = FileSystem.get(conf);
String input = Constants.POST_OUTPUT_DIR;
Path inputPath = new Path(input);
/*Path inputPath = new Path(input);
fil... |
ede3b98c-1e52-42e9-9eb8-39f136831934 | 6 | public int compareTo(Object o) {
Handler second = (Handler) o;
/* First sort by start offsets, highest address first... */
if (start.getAddr() != second.start.getAddr())
/* this subtraction is save since addresses are only 16 bit */
return second.start.getAddr() - start.getAddr();
/*
* ...Seco... |
e145a18e-f6e2-4a50-bd12-a47b43ebce20 | 7 | private static void randomQueueOp( Random rand, Queue<Integer> a, int range ) {
int op = rand.nextInt( 6 );
switch( op ) {
case 0:
case 1:
case 5:
{
Integer val = rand.nextInt( range );
a.offer( val );
break;
}
... |
19e6364d-1c8e-432e-83c4-5a29455cc86a | 6 | public static boolean isItemInList(int var0, int var1, String var2)
{
if (var2.trim().length() != 0)
{
String[] var3 = var2.split(";");
String[] var4 = var3;
int var5 = var3.length;
for (int var6 = 0; var6 < var5; ++var6)
{
... |
4eac285a-8054-4978-aec2-2559db47db79 | 0 | protected void onEntering() {
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.