id stringlengths 33 37 | content stringlengths 47 206k |
|---|---|
api-misuse-repair-complete_data_11801 | private void showNotification() { Notification.Builder builder = new Notification.Builder(getApplicationContext()); builder.setContentTitle(getString(R.string.notification_message)); builder.setOngoing(true); builder.setPriority(Notification.PRIORITY_MIN); builder.setSmallIcon(android.R.color.transparent); Notification... |
api-misuse-repair-complete_data_11802 | private void renderBar(Stat stat, float x, float y, SpriteBatch batch, int spacing, boolean rightSide) { float pointsPerIcon = stat.max * 1f / stat.iconCount; TextureRegion fullIcon = GameCore.icons.get(stat.icon); TextureRegion emptyIcon = GameCore.icons.get(stat.outlineIcon); int iconWidth = stat.iconWidth + spacing;... |
api-misuse-repair-complete_data_11803 | @Override public int getID() { return 0; }
@Override public int getID() { return id; }
|
api-misuse-repair-complete_data_11804 | public void mouseDragged(MouseEvent e) { if (isMouseDraggingPlayer && !animating) { int new_mx = e.getX(); int new_my = e.getY(); Point selectedPlayerPosition = selectedPlayer.getPositionAtFrame(selectedFrame); int playerPositionX = selectedPlayerPosition.getX(); int playerPositionY = selectedPlayerPosition.getY(); int... |
api-misuse-repair-complete_data_11805 | @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.inflate(R.layout.fragment_commits, container, false); mActivity = (RepoDetailActivity) getActivity(); mActivity.setCommitsFragment(this); mViewUtils = ViewUtils.getInstance(mActivity); Bundle ... |
api-misuse-repair-complete_data_11806 | @Override public void onDataPass(Module moduleToLoad, Bundle bundle) { if (bundle != null) { mBundle.putAll(bundle); } mBundle.putSerializable(Key.MODULE, moduleToLoad); Fragment prevFragment = mFragmentManager.findFragmentByTag(mPrevFragmentTag); Fragment nextFragment = getNextFragmentToLoad(moduleToLoad); mPrevFragme... |
api-misuse-repair-complete_data_11807 | @GetMapping("/{restaurantId}") public ResponseEntity<?> getItemById(@PathVariable int restaurantId) { List<Item> item = itemService.getItemByPopularity(restaurantId); if (item != null && item.size() != 0) { return new ResponseEntity<>(item, HttpStatus.OK); } else { return new ResponseEntity<>("No Restaurant by this id!... |
api-misuse-repair-complete_data_11808 | private void parseLocationTrigger(DenizenNPC theDenizen, Player thePlayer, String theLocationName) { if (plugin.debugMode) plugin.getLogger().log(Level.INFO, "Parsing Location Trigger."); ScriptHelper sE = plugin.getScriptEngine().helper; String theScriptName = theDenizen.getInteractScript(thePlayer, this.getClass()); ... |
api-misuse-repair-complete_data_11809 | private static String beautifyText(String text) { String returnText = text; try { String replaceCh = text.substring(text.indexOf('(') + 1, text.lastIndexOf(')')); if (replaceCh.length() < 1) { returnText = text.replace('(' + replaceCh + ')', ""); } } catch (Exception e) { } return returnText; }
private static String ... |
api-misuse-repair-complete_data_11810 | @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_rig_graph); refreshLock = false; rockDescriptionTableLayout = (TableLayout) findViewById(R.id.table_layout_rock_description_list); splitRockDescriptionTableLayout = (TableLayout) findViewB... |
api-misuse-repair-complete_data_11811 | @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); if (requestCode == REQUEST_PERMISSION_CODE) { for (int i = grantResults.length - 1; i >= 0; i--) { if (grantResults[i]... |
api-misuse-repair-complete_data_11812 | private void updateUI() { BipSss.Share last = shares.get(shares.size() - 1); String status = getString(R.string.sss_share_number_scanned, last.shareNumber); try { String secret = BipSss.combine(shares); Intent result = new Intent(); result.putExtra(RESULT_SECRET, secret); setResult(RESULT_OK, result); finish(); return;... |
api-misuse-repair-complete_data_11813 | public int gameOver() { int gameOver = -1; for (int i = 0; i < board.length; i++) { if (board[i] == 0) { gameOver = currentPlayer; } } return (gameOver); }
public int gameOver() { int gameOver = -1; for (int i = 0; i < board.length; i++) { if (board[i] == 0) { gameOver = board[i]; } } return (gameOver); }
|
api-misuse-repair-complete_data_11814 | @Override protected void onBeforeClusterItemRendered(Person person, MarkerOptions markerOptions) { mImageView.setImageBitmap(person.getPhoto()); Bitmap icon = mIconGenerator.makeIcon(); markerOptions.icon(BitmapDescriptorFactory.fromBitmap(icon)).title(person.toString()); long time = 0; if (person.getLocation() != null... |
api-misuse-repair-complete_data_11815 | public void cancel(Block block) throws InvalidSecurityContextException, TaskSubmissionException { try { getHandler(block.getTask().getProvider()).cancel(block.getTask()); } catch (InvalidProviderException e) { throw new TaskSubmissionException(e); } catch (ProviderMethodException e) { throw new TaskSubmissionException(... |
api-misuse-repair-complete_data_11816 | @Override synchronized protected Serializable handleRequest(PeerAddress sender, Object messageContent) { TaskMessage taskMessage = TaskMessage.check(messageContent); WorkerID workerID = taskMessage.getSenderID(); switch(taskMessage.getType()) { case REQUEST_CHALLENGE: System.out.println("Received request for a Challeng... |
api-misuse-repair-complete_data_11817 | public static Connection getConnection() { try { Class.forName(driverName); try { con = DriverManager.getConnection("jdbc:postgresql://localhost:5432/haryana_db", "postgres", "1234"); } catch (SQLException ex) { System.out.println("ex: " + ex); System.out.println("Failed to create the database connection."); } } catch ... |
api-misuse-repair-complete_data_11818 | @RequestMapping(path = "user/{uid}/recipe/{rid}", method = RequestMethod.GET) public Recipe show(HttpServletRequest req, HttpServletResponse res, @PathVariable int uid, @PathVariable int rid) { return recipedao.show(uid, rid); }
@RequestMapping(path = "search/recipe/{rid}", method = RequestMethod.GET) public Recipe s... |
api-misuse-repair-complete_data_11819 | @RequestMapping(value = "MakeMaster", method = RequestMethod.GET) public void markCurriculumAsMaster(HttpServletRequest request) { Curriculum c = curriculumService.getCuricullumById(Integer.parseInt(request.getParameter("curriculumId"))); c.setIsMaster(1); List<Curriculum> curriculumList = curriculumService.findAllCurr... |
api-misuse-repair-complete_data_11820 | @RequestMapping("/doBoreholeViewFilterStyle.do") public void doFilterStyle(HttpServletResponse response, @RequestParam(required = false, value = "serviceUrl", defaultValue = "") String serviceUrl, @RequestParam(required = false, value = "boreholeName", defaultValue = "") String boreholeName, @RequestParam(required = fa... |
api-misuse-repair-complete_data_11821 | public void initScriptControl(String filePath) throws FileNotFoundException { String text = filePath; if (filePath.length() > 24) { text = filePath.substring(0, 3) + "..." + filePath.substring(filePath.length() - 18); } if (!staticComposite.isDisposed()) { scriptLabel.setText(text); scriptLabel.setToolTipText(filePath)... |
api-misuse-repair-complete_data_11822 | @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_clock); Log.d("CLOCK_ACTIVITY", "onCreate"); alarmList.add(new Alarm(1, new Date(1000000), true)); alarmList.add(new Alarm(2, new Date(2000000), false)); alarmList.add(new Alarm(3, new Dat... |
api-misuse-repair-complete_data_11823 | @SuppressWarnings("unchecked") private void initComponents() { mainPanel = new javax.swing.JPanel(); exitButton = new javax.swing.JButton(); alterBudgetButton = new javax.swing.JButton(); graphDataButton = new javax.swing.JButton(); addExpensesButton = new javax.swing.JButton(); editExpensesButton = new javax.swing.JBu... |
api-misuse-repair-complete_data_11824 | private void start() { initLog(SENDER_LOG_SETTINGS_FILE); threadPool = Executors.newScheduledThreadPool(1); Runtime.getRuntime().addShutdownHook(new ShutdownHook()); try { settings = loadSettingsFromFile(SENDER_SETTINGS_FILE); } catch (LoadSettingsException e) { logger.log(Level.WARNING, "Error loading setting, use def... |
api-misuse-repair-complete_data_11825 | public static EmbedObject getPreEventEmbed(PreEvent event) { EmbedBuilder em = new EmbedBuilder(); em.withAuthorIcon(Main.client.getGuildByID("266063520112574464").getIconURL()); em.withAuthorName("DisCal"); em.withTitle("Event Info"); em.appendField("Event Name/Summary", event.getSummary(), true); em.appendField("Even... |
api-misuse-repair-complete_data_11826 | public MonkeyLearnResponse detail(String moduleId, int category_id) throws MonkeyLearnException { return this.detail(moduleId, category_id, true); }
public MonkeyLearnResponse detail(String module_id, int category_id) throws MonkeyLearnException { return this.detail(module_id, category_id, true); }
|
api-misuse-repair-complete_data_11827 | public Orient shutdown() { getLock().lock(); try { if (!active) return this; active = false; if (memoryWatchDog != null) { memoryWatchDog.interrupt(); try { memoryWatchDog.join(); } catch (InterruptedException e) { } } if (shutdownHook != null) { shutdownHook.cancel(); shutdownHook = null; } OLogManager.instance().debu... |
api-misuse-repair-complete_data_11828 | public void displayFloorLinesAndMarkers(Integer floorID, boolean visibility) { List<Polyline> floorLines = floorLineMap.get(floorID); List<Marker> markerList = floorMarkerMap.get(floorID); for (Polyline line : floorLines) { line.setVisible(visibility); } for (Marker marker : markerList) { marker.setVisible(visibility);... |
api-misuse-repair-complete_data_11829 | private double computeReward(Player player, ecoReward reward) { double amount = reward.getRewardAmount(); try { if (plugin.getPermission().getPrimaryGroup(player.getWorld().getName(), player.getName()) != null) { String group = plugin.getPermission().getPrimaryGroup(player.getWorld().getName(), player.getName()).toLowe... |
api-misuse-repair-complete_data_11830 | private void consumeStmt() { if (test(EOF) || test(END)) { throw new RecognitionException("No statement provided", start, end); } if (test(VAR)) { consumeAssign(); } else if (test(LOOP)) { if (language != Language.LOOP) { throw new RecognitionException("Illegal statement loop in lang " + language, start, end); } consum... |
api-misuse-repair-complete_data_11831 | private List<String> generateLoreInternal(ExilePearl pearl, int health, boolean addCommandHelp) { List<String> lore = new ArrayList<String>(); Integer healthPercent = Math.min(100, Math.max(0, (int) Math.round(((double) health / config.getPearlHealthMaxValue()) * 100))); lore.add(parse("<l>%s", pearl.getItemName())); l... |
api-misuse-repair-complete_data_11832 | public boolean updateBuild(String index, Build build) throws SQLException { Connection conn = DBConnection.getConnection(); PreparedStatement stat = conn.prepareStatement(DashboardDAO.updateBuildQuery); DashboardDAO.setValues(stat, index, build.getResult(), build.getUrl()); boolean result = stat.execute(); DBConnection... |
api-misuse-repair-complete_data_11833 | private void init() { totalCount = 0; for (Row row : rows) { totalCount += row.occurrence; } switch(mode) { case SIMPLE: if (rows.length != 1) { throw new IllegalArgumentException("Only one row allowed for SIMPLE mode"); } simpleMaterial = rows[0].material; patternHeight = -1; break; case NOISE: if (rows.length < 2) { ... |
api-misuse-repair-complete_data_11834 | @ApiOperation(value = "Launch a given workflow.", authorizations = { @Authorization("ADMIN"), @Authorization("APPLICATION_MANAGER") }) @RequestMapping(value = "/{applicationId:.+}/environments/{applicationEnvironmentId}/workflows/{workflowName}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)... |
api-misuse-repair-complete_data_11835 | @Override public void fight(Player opponent) { System.out.println("Ra�s al Ghul greift dich an"); Random random = new Random(); int abzug = random.nextInt(strength) + 1; opponent.loseHitpoints(abzug); Random generator = new Random(); int ran = generator.nextInt(4); switch(ran) { case 0: System.out.println("Er verbrennt... |
api-misuse-repair-complete_data_11836 | @Override public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); ArrayList<String> tags = new ArrayList<String>(); for (TagTableRow tagTableRow : tagEntries) { tags.add(tagTableRow.getSelection()); } outState.putStringArrayList(BUNDLE_TAGS, tags); }
@Override public void onSaveInstanc... |
api-misuse-repair-complete_data_11837 | @Override public void run() { if (count > regions.length) { this.cancel(); return; } region: for (int i = 0; i < Regionerator.getInstance().getRegionsPerCheck(); i++) { Pair<Integer, Integer> regionCoordinates = parseRegion(regions[count]); count++; for (int chunkX = regionCoordinates.getLeft(); chunkX < regionCoordina... |
api-misuse-repair-complete_data_11838 | public HashMap<String, Object> getTaskMap(ArrayList<String> parameterList) { HashMap<String, Object> updateAttributes = new HashMap<String, Object>(); for (String parameter : parameterList) { String key = UtilityMethod.getFirstWord(parameter); String value = UtilityMethod.removeFirstWord(parameter); switch(key) { case ... |
api-misuse-repair-complete_data_11839 | public void drawPlayer(Rectangle[] rect, Graphics g, int playerNum, int team) { if (!playerInStart[playerNum]) { g.drawImage(playerImgs[playerNum], rect[getPos(playerNum)].getX(), rect[getPos(playerNum)].getY()); } else { switch(team) { case 0: g.drawImage(playerImgs[playerNum], 64 + (playerNum * 32), 0); break; case 1... |
api-misuse-repair-complete_data_11840 | @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; AbstractServerChessGame other = (AbstractServerChessGame) obj; if (id != other.id) return false; return uid != other.uid; }
@Override public boolean equals(Object ... |
api-misuse-repair-complete_data_11841 | static Object eval(Object n, Environment env) throws Throwable { if (n instanceof Symbol) { Object r = env.get(((Symbol) n).code); return r; } else if (n instanceof Vector) { Vector<Object> r = new Vector<Object>(); for (Object x : (Vector<?>) n) { r.add(eval(x, env)); } return r; } else if (n instanceof ArrayList) { L... |
api-misuse-repair-complete_data_11842 | @Override public Iterator<OIdentifiable> iterator() { return new OLazyRecordIterator(new OLazyIterator<OIdentifiable>() { { if (OSerializationSetThreadLocal.check((ODocument) sourceRecord)) { iter = new HashSet<Entry<OIdentifiable, Object>>(ORecordLazySet.super.map.entrySet()).iterator(); } else iter = ORecordLazySet.s... |
api-misuse-repair-complete_data_11843 | protected void addPaymentInfoData(String rawResponse, PayPalPaymentResponse response) { PayPalPaymentInfo paymentInfo = new PayPalPaymentInfo(); response.setPaymentInfo(paymentInfo); String currencyCode = getResponseValue(rawResponse, replaceNumericBoundProperty(MessageConstants.PROCESSPAYMENTCURRENCYCODE, new Integer[... |
api-misuse-repair-complete_data_11844 | private void establishConnection() { if (socket != null && !socket.isClosed()) { try { socket.close(); } catch (IOException e) { LOG.error(e); } } socket = new Socket(); int retryCount = 1; while (!socket.isConnected() && retryCount <= socketConnectionRetries) { try { socket.connect(metricsServers.get(0)); } catch (IOE... |
api-misuse-repair-complete_data_11845 | public void modelPropertyChange(PropertyChangeEvent event) { if (event.getPropertyName().equals(StructureManager.PC_IMAGES_READY)) { images = (HashMap<ImageType, BufferedImage>) event.getNewValue(); } else if (event.getPropertyName().equals(World.PC_NEW_STRUCTURE)) { structures.add((Structure) event.getNewValue()); } e... |
api-misuse-repair-complete_data_11846 | protected PrimeNumberGraph constructFullGraph(Set<SymbolVertex> vertices) { List<Edge> allEdges = Lists.newArrayList(); SymbolVertex[] verIter = (SymbolVertex[]) vertices.toArray(); for (int i = 0; i < vertices.size(); i++) { for (int j = i + 1; j < vertices.size(); j++) { Edge edge = new Edge(verIter[i], verIter[j]); ... |
api-misuse-repair-complete_data_11847 | public void createBiomeGroups(File configDirectory, MinecraftServer minecraftServer) { Configuration worldConfig = new Configuration(new File(configDirectory, DefaultProps.WORLDSETTINGSDIR + Properties.saveName + "/" + "BiomeGroups" + ".cfg")); worldConfig.load(); for (BiomeGenBase biome : BiomeGenBase.biomeList) { if ... |
api-misuse-repair-complete_data_11848 | @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.add_lamb); Log.i("AddLamb", " after set content view"); View v = null; String dbfile = getString(R.string.real_database_file); Log.i("AddLamb", " after get database file"); dbh = new DatabaseHandler(t... |
api-misuse-repair-complete_data_11849 | protected void initTranslations(CrowdinFile _master) { File dir = _master.getFile().getParentFile(); String masterFileName = _master.getFile().getName(); if (_master.isShouldBeCleaned()) { _master.getFile().delete(); } List<File> files = new ArrayList<File>(); if ((dir.getPath().contains("android")) || ((dir.getPath().... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.