id
stringlengths
33
37
content
stringlengths
47
206k
api-misuse-repair-complete_data_201
@Override public void action(String[] args, MessageReceivedEvent event) { String sound = args[1]; switch(sound) { case "rick": Random r = new Random(); int number = r.nextInt(4); System.out.println(number); if (number != 3) { voiceCommandExecution(event, "rickHarrison.mp3"); } else { voiceCommandExecution(event, "rickR...
api-misuse-repair-complete_data_202
@EventHandler public void preInit(FMLPreInitializationEvent event) { config = new Configuration(new File(event.getModConfigurationDirectory(), "bbm/ve/VoltzEngine.cfg")); heatDataConfig = new Configuration(new File(event.getModConfigurationDirectory(), "bbm/ve/HeatMap.cfg")); explosiveConfig = new Configuration(new Fil...
api-misuse-repair-complete_data_203
protected boolean getBooleanProperty(String key) { Object value = getProperty(key); if (value != null) { if (value instanceof Boolean) { return (Boolean) value; } else if (value instanceof String) { return Boolean.valueOf((String) value); } } return Boolean.FALSE; } protected Boolean getNullableBooleanProperty(String...
api-misuse-repair-complete_data_204
@Override public void fight(final IDelegateBridge bridge) { removeUnitsThatNoLongerExist(); if (m_stack.isExecuting()) { showBattle(bridge); m_stack.execute(bridge); return; } updateDefendingUnits(); bridge.getHistoryWriter().startEvent("Strategic bombing raid in " + m_battleSite, m_battleSite); if (m_attackingUnits.is...
api-misuse-repair-complete_data_205
public void isValid(Context context, Item item, Collection collection) throws IllegalStateException, SQLException { List<String> mandatory = this.getMandatoryList(collection.getHandle()); for (String field : mandatory) { Metadatum[] value = item.getMetadataByMetadataString(field); if (value.length == 0) { if (!"dc.cont...
api-misuse-repair-complete_data_206
public boolean onStrike(World world, MovingObjectPosition target, EntityLivingBase caster, float modifier) { if (target.entityHit != null) { if (!target.entityHit.isImmuneToFire()) { target.entityHit.attackEntityFrom(DamageSource.inFire, getPower()); target.entityHit.setFire(getDuration() / 20); } } if (Config.flamethr...
api-misuse-repair-complete_data_207
private static String stripTypeParameters(String type) { int typeParamStart = type.indexOf("<"); if (typeParamStart != -1) { return type.substring(0, typeParamStart); } else { return type; } } private static String stripTypeParameters(String type) { int typeParamStart = type.indexOf('<'); if (typeParamStart != -1) { ...
api-misuse-repair-complete_data_208
@SuppressWarnings("unchecked") public void updateEntityLookupTable() { List<AccessRecord> records = accessRecordDao.nextRecords(); Map<String, Object>[] batchValues = new Map[records.size()]; for (int i = 0; i < records.size(); i++) { AccessRecord record = records.get(i); Map<String, Object> value = new HashMap<String,...
api-misuse-repair-complete_data_209
private static void writeOutput(String outputFileName, LngpokOutputData outputData) throws IOException { try (Writer outputFileWriter = new FileWriter(outputFileName)) { outputFileWriter.write(String.valueOf(outputData.getLongestSequenceLength())); } } private static void writeOutput(String outputFileName, DataLngpok...
api-misuse-repair-complete_data_210
@Override public void collide(GameObject O) { super.collide(O); if (O instanceof Wall) { this.noMove(); this.turnAround(); } } @Override public void collide(GameObject O) { super.collide(O); if (!(O instanceof ToggleWall)) { if (O instanceof Wall) { this.noMove(); } } }
api-misuse-repair-complete_data_211
public static void printMenuMessage(byte i) { if (i == 1) { System.out.println("# $$$$ $$ $$ $$$ $$ $$ $$$$$ $ $ $$$$ $$$$$ #"); System.out.println("# $$ $$ $$ $$ $$ $$ $$ $$ $$ $ $$ $$ #"); System.out.println("# $ $$$$$ $$$$$ $$ $$ $$$$ $ $ $ $ $$ $$$ #"); System.out.println("# $$ $$ $$ $$ $$ $$ $$ $$ $ $$ $$ $ $$ #")...
api-misuse-repair-complete_data_212
private ArrayList<Integer> writeStripData(IFD ifd) throws IOException { ArrayList<Integer> newStripOffsets = new ArrayList<Integer>(); IfdTags metadata = ifd.getMetadata(); TagValue stripOffsets = metadata.get(273); TagValue stripSizes = metadata.get(279); for (int i = 0; i < stripOffsets.getCardinality(); i++) { int p...
api-misuse-repair-complete_data_213
private void fillMatchingTerms(List<AutoCompleterItem> result, List<GlossaryEntry> glossary, String context) { if ("".equals(context)) { return; } for (GlossaryEntry entry : glossary) { for (String term : entry.getLocTerms(true)) { if (!termMatchesChunk(term, context)) { continue; } String payload = matchCapitalization...
api-misuse-repair-complete_data_214
public static Result searchByKeyword(String keyword) { ObjectNode result = Json.newObject(); int page = 1; int size = 10; String category = request().getQueryString("category"); String source = request().getQueryString("source"); String pageStr = request().getQueryString("page"); if (StringUtils.isBlank(pageStr)) { pag...
api-misuse-repair-complete_data_215
@Override public boolean addDestinationNode(IndiNode in) { String nodeId = in.getNodeId(); if (!this.destinationNodes.containsKey(nodeId)) { this.destinationNodes.put(nodeId, in); if (in.getType() == IndiNodeType.DECISION) { String indoNodeId = this.getNodeId() + "_" + nodeId; IndiNodeDecisionOption indo = new IndiNode...
api-misuse-repair-complete_data_216
@Override public boolean configure(MediaToolConfig config) { try { this.formatString = config.getRenameMedia().get("format"); this.destination = config.getDestination(); this.tokens = TokenParser.parseTokens(this.formatString); this.enabled = Boolean.parseBoolean(config.getRenameMedia().get("enabled")); return true; } ...
api-misuse-repair-complete_data_217
public void run() { while (!Thread.currentThread().isInterrupted()) { InputStream stream; InputStream tmpIn = null; try { l("Loading input stream"); tmpIn = connectedSocket.getInputStream(); } catch (IOException e) { Log.e("[Bluetooth]", "Error occurred when creating input stream", e); } stream = tmpIn; l("Reading stre...
api-misuse-repair-complete_data_218
private boolean checkAuthorizationHeader(String authHeader) throws IOException { return accessTokenManager.isValid(AccessToken.fromString(authHeader)); } private boolean checkAuthorizationHeader(Optional<String> authHeader) throws IOException { return authHeader.map(x -> accessTokenManager.isValid(AccessToken.fromStr...
api-misuse-repair-complete_data_219
public void paint(Graphics g) { g.setColor(Color.LIGHT_GRAY); g.fillRect(0, 0, getWidth() - 1, getHeight() - 1); g.setColor(Color.black); g.drawRect(0, 0, getWidth() - 1, getHeight() - 1); g.setFont(WorkbenchFonts.getTitle2Font()); FontMetrics fm = g.getFontMetrics(); int y = fm.getHeight(); g.drawString("Maximum Popul...
api-misuse-repair-complete_data_220
void run(final String pipelineName) throws Exception { Method transformMethod = transformFinder.find(pipelineName); if (transformMethod == null) { logger.error("Could not find a pipeline transformer annotated with @DataflowTransformer named {}", pipelineName); throw new IllegalArgumentException("No transformer named " ...
api-misuse-repair-complete_data_221
public void contextInitialized(ServletContextEvent arg0) { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); try { PropertyConfigurator.configure(getClass().getResourceAsStream(properties)); Config.getInstance(); GeoCoder.getInstance(); Repository.getInstance(); MongoDB.getInstance(); List<String> indexes = new ArrayLi...
api-misuse-repair-complete_data_222
private void moveTo(Integer index, Node parent) { checkNonRoot(); ((ApiNode) parent).checkChildrenLoaded(); if (this.getNodePath().isParent(parent.getNodePath())) { throw new IllegalArgumentException("Can't move node to a child node of itself"); } Node root = this; while (root.getParent() != null) { root = root.getPare...
api-misuse-repair-complete_data_223
public static String generateHBaseTableSchema(Schema schema) throws Exception { String template = ReadFileFromJar.getTextFileContent("/com/bizosys/hsearch/treetable/compiler/templates/HBaseTableSchema.tmp"); template = template.replace("--PACKAGE--", schema.module); StringBuilder families = new StringBuilder(4096); for...
api-misuse-repair-complete_data_224
@Override public void toBytes(ByteBuf buf) { int poolID = PlayerHookCore.locate().getPoolID(this.playerHook.getParentPool()); buf.writeInt(poolID); this.playerHook.getProfile().writeToClient(buf); this.playerHook.writeToClient(buf); } @Override public void toBytes(ByteBuf buf) { int poolID = PlayerCore.locate().getPo...
api-misuse-repair-complete_data_225
public static String formatGradeForDisplay(final String grade) { if (StringUtils.isBlank(grade)) { return ""; } String s = null; try { final DecimalFormat dfParse = (DecimalFormat) NumberFormat.getInstance(Locale.ROOT); dfParse.setParseBigDecimal(true); final BigDecimal d = (BigDecimal) dfParse.parse(grade); final Deci...
api-misuse-repair-complete_data_226
public Map<String, Object> varsAsMap() { ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder(); if (this.index != null) { builder.put("_index", this.index); } if (this.type != null) { builder.put("_type", this.type); } if (this.id != null) { builder.put("_id", this.id); } if (this.version != null) { bui...
api-misuse-repair-complete_data_227
private double executeCountQuery(String countQuery) { Query query = QueryFactory.create(countQuery); QueryExecution queryExecution = QueryExecutionFactory.sparqlService(this.ENDPOINT_URI, query); ResultSet resultSet = null; try { resultSet = queryExecution.execSelect(); } catch (QueryExceptionHTTP e) { System.err.print...
api-misuse-repair-complete_data_228
@Nullable public static Object getNext(Bundle bundle) { return getNext(bundle.keySet()); } @Nullable public static Object getNext(Bundle bundle) { final String nextKey = getNextKey(bundle.keySet()); return nextKey == null ? null : bundle.get(nextKey); }
api-misuse-repair-complete_data_229
public void paint(Graphics g) { g.setColor(Color.RED); g.drawArc(100, 50, 50, 50, x, 160); g.drawArc(95, 45, 60, 60, y, 180); } public void paint(Graphics g) { super.paint(g); Graphics2D g2 = (Graphics2D) g; g2.setColor(Color.RED); g2.setStroke(new BasicStroke(3)); g2.drawArc(100, 50, 50, 50, x, 160); g2.drawArc(95, ...
api-misuse-repair-complete_data_230
@Override protected void initWidget(View parentView) { super.initWidget(parentView); mRv.setLayoutManager(mManager); mRv.setAdapter(mAdapter); mAdapter.setViewCallBack(new RecommendedViewAdapter.ViewCallBack() { @Override public void onClickListener(DataBean dataBean) { Intent intent = new Intent(); intent.putExtra("co...
api-misuse-repair-complete_data_231
public static String whatIsToTheEast(int x, int y, String[][] myMap) { String result = ""; if (x <= NUM_OF_ROWS) { result = myMap[x + 1][y]; } return result; } public static String whatIsToTheEast(int x, int y, String[][] myMap) { String result = ""; if (x < NUM_OF_COLUMNS - 1) { result = myMap[x + 1][y]; } return re...
api-misuse-repair-complete_data_232
@Override protected String checkIfGameOver() { if (state.player0Score >= 50) { return "Player 1 Wins with a Score of: " + state.player0Score; } else if (state.player1Score >= 50) { return "Player 2 Wins with a Score of: " + state.player1Score; } else { return null; } } @Override protected String checkIfGameOver() { i...
api-misuse-repair-complete_data_233
public static String sanitizeAttackSource(String value, String description, Context contexto) { if (description.compareTo("bonusattackdamage") == 0) { description = (Float.parseFloat(value) * 100) + "% " + contexto.getResources().getString(R.string.bonus_attack_damage); } else if (description.compareTo("spelldamage") =...
api-misuse-repair-complete_data_234
@Override protected void onResume() { super.onResume(); } @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); maybeUpdateWallpaperDetailOpenedClosed(); }
api-misuse-repair-complete_data_235
@Override public boolean unlock(UnlockContext context) { Session session = null; try { session = BasicDaoFactory.getSystemSession(); boolean restorePreviousVersion = context.isForce(); String contentLanguage = I18NHelper.checkLanguage(context.getLang()); SimpleDocument document = repository.findDocumentById(session, ne...
api-misuse-repair-complete_data_236
@Override public void initialize() { port = (String) getThing().getConfiguration().get("port"); logger.warn("got port: " + port); initSerialPort(port); try { portId = CommPortIdentifier.getPortIdentifier(port); serialPort = portId.open("openHAB", 2000); serialPort.setSerialPortParams(baud, databits, stopbit, parity); i...
api-misuse-repair-complete_data_237
private void checkRequestBody(MessageContext messageContext) { org.apache.axis2.context.MessageContext axis2MC = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); if (enabledCheckBody && axis2MC.getEnvelope() != null) { String payload = axis2MC.getEnvelope().getBody().getFirstElement().toString(); if (pa...
api-misuse-repair-complete_data_238
public void loadXADataSources(final AsyncCallback<List<XADataSource>> callback) { ModelNode operation = new ModelNode(); operation.get(OP).set(READ_CHILDREN_RESOURCES_OPERATION); operation.get(ADDRESS).set(getBaseAddress()); operation.get(ADDRESS).add("subsystem", "datasources"); operation.get(CHILD_TYPE).set("xa-data-...
api-misuse-repair-complete_data_239
public void update() { this.physWorld.getBodies(this.physBodies); this.worldTime++; for (Body body : this.physBodies) { Object object = body.getUserData(); if (object instanceof Entity) ((Entity) object).update(); } this.physWorld.step(1F / ReleaseTheKraken.TICK_RATE, 6, 2); for (Body body : this.physBodiesToRemove) { ...
api-misuse-repair-complete_data_240
@EventHandler public void entityDamageByEntity(EntityDamageByEntityEvent event) { if (isAfk((Player) event.getDamager())) { event.setCancelled(true); } } @EventHandler public void entityDamageByEntity(EntityDamageByEntityEvent event) { Entity damagerEntity = ((EntityDamageByEntityEvent) event).getDamager(); if (isAfk...
api-misuse-repair-complete_data_241
@Override public void setGuidedAltitude(double altitude) { if (isApiValid()) { try { dpApi.setGuidedAltitude(altitude); } catch (RemoteException e) { handleRemoteException(e); } } } @Override public void setGuidedAltitude(double altitude) { if (isConnected()) { try { dpApi.setGuidedAltitude(altitude); } catch (Remote...
api-misuse-repair-complete_data_242
public boolean updateLocalData() { try { remoteData.load(); appData.load(); if (remoteData.Current != null) { Current current = remoteData.Current; if (current.Desktop != null && current.Desktop.DesktopItem != null) { desktopItems.DesktopItem = current.Desktop.DesktopItem; } else { ArrayList<Item> items = new ArrayList...
api-misuse-repair-complete_data_243
@Override public void run() { try { Path outputDirectory = AppOptions.getInstance().getOutputDirectory().toPath(); FileStore fileStore = Files.getFileStore(outputDirectory); double bytesFree = fileStore.getUnallocatedSpace(); double totalSpace = fileStore.getTotalSpace(); double percentFree = bytesFree / totalSpace * 1...
api-misuse-repair-complete_data_244
private void send_notification(Context ctx) { SharedPreferences set_prefs = PreferenceManager.getDefaultSharedPreferences(ctx); Locale current_locale = ctx.getResources().getConfiguration().locale; SimpleDateFormat formatter = new SimpleDateFormat("EEE, dd/MM HH:mm", current_locale); String message = "Rsync configurati...
api-misuse-repair-complete_data_245
private Widget createUsersPanel() { HorizontalPanel mainUsersPanel = new HorizontalPanel(); SimplePanel hSpacer = new SimplePanel(); hSpacer.setWidth("15px"); mainUsersPanel.add(hSpacer); VerticalPanel availablePanel = new VerticalPanel(); mainUsersPanel.add(availablePanel); hSpacer = new SimplePanel(); hSpacer.setHeig...
api-misuse-repair-complete_data_246
protected void inflateList(LayoutInflater inflater, View container, Bundle savedInstanceState) { ViewStub stub = (ViewStub) container.findViewById(android.R.id.list); if (stub != null) { ViewGroup parent = (ViewGroup) stub.getParent(); if (parent != null) { View listView = super.onCreateView(inflater, parent, savedInst...
api-misuse-repair-complete_data_247
public JSONArray getTopGenesAsJSON(Patient patient, int g, int v) { JSONArray result = new JSONArray(); if (patient == null || g < 0) { return result; } Exome patientExome = exomeManager.getExome(patient); for (String geneName : patientExome.getTopGenes(g)) { JSONObject geneJSON = new JSONObject(); geneJSON.element("na...
api-misuse-repair-complete_data_248
void checkInput(float x, float y) { CellObject actor = model.curActor; if (actor != null) { if (TimeUtils.timeSinceMillis(time) > TOUCH_DELAY) { int touchX = ru.mitrakov.self.rush.screens.Gui.convertXFromScreenToModel(x); int touchY = ru.mitrakov.self.rush.screens.Gui.convertYFromScreenToModel(y); if (touchY < actor.ge...
api-misuse-repair-complete_data_249
void initialize() { sharedPrefs = new SharedPrefs(getContext()); afterBirthListAdapter = new AfterBirthListAdapter(getContext(), this); beforeBirthListAdapter = new BeforeBirthListAdapter(getContext(), this); layoutManager = new LinearLayoutManager(getContext()); layoutManager1 = new LinearLayoutManager(getContext()); ...
api-misuse-repair-complete_data_250
public void createLinkWidget(Composite parent) { linkComp = new Composite(parent, SWT.BORDER); linkComp.setLayout(new GridLayout(3, false)); Label linkTitle = new Label(linkComp, SWT.WRAP); linkTitle.setText(getTitle()); linkTitle.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); Button linkButton = new But...
api-misuse-repair-complete_data_251
public void run() { Bootstrap b = new Bootstrap(); b.group(new NioEventLoopGroup()).option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 120).channel(NioSocketChannel.class).handler(new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast("Repeati...
api-misuse-repair-complete_data_252
@RequestMapping(value = "/sign-out-request", method = RequestMethod.POST) public ModelAndView sendEmail(HttpSession session, Model model) { ModelAndView view = new ModelAndView("index"); session.invalidate(); model.asMap().clear(); return view; } @RequestMapping(value = "/sign-out-request", method = RequestMethod.POS...
api-misuse-repair-complete_data_253
public byte[] unwrap(byte[] in, int inOff, int inLen) throws InvalidCipherTextException { if (forWrapping) { throw new IllegalStateException("not set for unwrapping"); } if ((in.length - inOff) % engine.getBlockSize() != 0) { throw new DataLengthException("unwrap data must be a multiple of " + engine.getBlockSize() + "...
api-misuse-repair-complete_data_254
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); textView = (TextView) findViewById(R.id.textView); roundView = (TextView) findViewById(R.id.roundView); startButton = (Button) findViewById(R.id.button); pauseButton = (Button) find...
api-misuse-repair-complete_data_255
@RequestMapping("/doMorphTestAjax") public void morphTestAjax(HttpServletRequest request, HttpServletResponse response) throws Exception { String keyword = request.getParameter("keyword"); String collectionName = request.getParameter("collectionName"); logger.debug("keyword : {}, collectionName : {}", keyword, collecti...
api-misuse-repair-complete_data_256
@Override public Plumber findPlumber(final Schema schema, final FireDepartmentMetrics metrics) { verifyState(); initializeExecutors(); computeBaseDir(schema).mkdirs(); final Map<Long, Sink> sinks = Maps.newConcurrentMap(); for (File sinkDir : computeBaseDir(schema).listFiles()) { Interval sinkInterval = new Interval(si...
api-misuse-repair-complete_data_257
@Override public void writeTo(final RLPOutput rlpOutput) { BytesValueRLPOutput ibftMessage = new BytesValueRLPOutput(); ibftMessage.startList(); roundChangeIdentifier.writeTo(ibftMessage); roundChangeCertificate.writeTo(ibftMessage); ibftMessage.endList(); } @Override public void writeTo(final RLPOutput rlpOutput) { ...
api-misuse-repair-complete_data_258
private StrategyNode chooseNodeWithTimes(StrategyNode parentNode) { try { long start = System.currentTimeMillis(); StrategyNode defaultNode = null; StrategyNode selected = null; final List<StrategyNode> childrenNodes = gatherChildrenNodes(parentNode); long branchWait = parentNode.getDuration(); for (Iterator<StrategyNo...
api-misuse-repair-complete_data_259
@Override public Solution solve(Function f, Map<String, Object> arguments) throws ArgumentsException, NoSolutionException { init(f, arguments); points.add(start_point); for (iterations = 1; iterations < max_iterations; iterations++) { points.add(f.getValue(points.get(iterations - 1))); double absoluteError = Math.abs(p...
api-misuse-repair-complete_data_260
public static void main(String[] args) throws InterruptedException, IOException { GameEngine game = new GameEngine(); game.init(); game.changeState(MenuState.getInstance()); while (game.Running()) { game.handleEvents(); game.update(); game.draw(); } } public static void main(String[] args) throws InterruptedException...
api-misuse-repair-complete_data_261
public long getAutoAcceptFileSize() { String config = this.xmppConnectionService.getPreferences().getString("auto_accept_file_size", "0"); try { return Long.parseLong(config); } catch (NumberFormatException e) { return 0; } } public long getAutoAcceptFileSize() { String config = this.xmppConnectionService.getPreferen...
api-misuse-repair-complete_data_262
public static void main(String[] args) throws Exception { InputStream configStream = ClassLoader.getSystemClassLoader().getResourceAsStream("config.json"); config = (JSONObject) JSONValue.parse(new InputStreamReader(configStream)); InputStream databaseConfigStream = ClassLoader.getSystemClassLoader().getResourceAsStrea...
api-misuse-repair-complete_data_263
public void redirectJumpsToThisTo(Unit newLocation) { List<UnitBox> boxesPointing = this.getBoxesPointingToThis(); UnitBox[] boxes = boxesPointing.<UnitBox>toArray(null); for (UnitBox box : boxes) { if (box.getUnit() != this) throw new RuntimeException("Something weird's happening"); if (box.isBranchTarget()) box.setUn...
api-misuse-repair-complete_data_264
public static void main(String[] args) { ArgParser ap = new ArgParser(args); if ((!ap.hasKey("peak") && !ap.hasKey("speak") && !ap.hasKey("region") && !ap.hasKey("sregion"))) { System.err.println("Please provide peak, region, sregion file !"); System.err.println("Usage:\n" + "RegionCountSorter\n" + "--species <organism...
api-misuse-repair-complete_data_265
private void makeMap() { map = new BufferedImage(rows * CELL_DEFAULT_WIDTH, cols * CELL_DEFAULT_HEIGHT, BufferedImage.TYPE_INT_ARGB); Graphics graphics = map.createGraphics(); for (int i = 0; i < mapMatrix.length; i++) { for (int j = 0; j < mapMatrix[0].length; j++) { Image image = null; switch(mapMatrix[i][j]) { case ...
api-misuse-repair-complete_data_266
public boolean isFull(int row, int col) { return this.isOpen(row, col) && this.uf.connected(0, this.translate(row, col)); } public boolean isFull(int row, int col) { return this.isOpen(row, col) && (this.uf.connected(this.siteCount, this.translate(row, col)) && this.uf.connected(0, this.translate(row, col))); }
api-misuse-repair-complete_data_267
public boolean onPrepareOptionsMenu(Menu menu) { CarRampPhysicsV2.menu = menu; menu.setGroupEnabled(0, useMenu); return true; } public boolean onPrepareOptionsMenu(Menu menu) { CarRampPhysicsV2.menu = menu; menu.setGroupEnabled(0, useMenu); return useMenu; }
api-misuse-repair-complete_data_268
private void scrollToChild(int position) { if (tabCount == 0) { return; } View nextFocused = tabsContainer.getChildAt(position); final Rect mTempRect = new Rect(); final int maxJump = getMaxScrollAmount(); int direction = parsePositionToDirection(position); if (nextFocused != null && isWithinDeltaOfScreen(nextFocused, ...
api-misuse-repair-complete_data_269
private void saveModel(HBaseAdmin admin, Configuration conf) throws IOException { if (!admin.tableExists(systemTable)) { HTableDescriptor htd = new HTableDescriptor(systemTable); HColumnDescriptor hcd = new HColumnDescriptor(HBL_SYSTEM_FAMILY); hcd.setMaxVersions(10); hcd.setInMemory(true); hcd.setTimeToLive(Integer.MA...
api-misuse-repair-complete_data_270
private void initEvent() { yes.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Word word = new Word(); word.gender = genderET.getText().toString(); word.word = wordET.getText().toString(); if (WordsAccess.getSettingsValueByName("language").equals("德语")) { word.plural = plET.getTe...
api-misuse-repair-complete_data_271
public static boolean UpdateRemoteEndpoint(GraphConfig grConf, VirtGraph vSet) { boolean isTargetEndpointLocal = Utilities.isURLToLocalInstance(grConf.getTargetGraph()); if (isTargetEndpointLocal) { System.out.println("\n\n\n\nSPARQL"); LocalUpdateGraphs(grConf, vSet); } else { System.out.println("\n\n\n\nSPARQL"); SPA...
api-misuse-repair-complete_data_272
public List<Pair<Item, Integer>> getSelectedItems() { List<Pair<Item, Integer>> items = new ArrayList<>(); int[] idxs = getSelectedIndices(); for (int i : idxs) { Pair<ListEntryType, Item> pair = ((Model) getModel()).getElementTypeAt(i); int rootId = i; while (rootId >= 0 && ((Model) getModel()).getElementAt(rootId) ==...
api-misuse-repair-complete_data_273
private void createShakeTween() { Timeline.createSequence().push(Tween.to(position, PositionComponentAccessor.ANGLE, 1.0f / 32.0f).target(position.getAngle() + 2).ease(Linear.INOUT)).push(Tween.to(position, PositionComponentAccessor.ANGLE, 1.0f / 16.0f).target(position.getAngle() + -4).ease(Linear.INOUT)).push(Tween.to...
api-misuse-repair-complete_data_274
@PreAuthorize("hasRole('ROLE_ANONYMOUS')") @RequestMapping(value = "/forgot_password", method = RequestMethod.POST) public String handleForgotPasswordEmail(@RequestParam("email") String email, HttpServletRequest request, Model model) { String baseLink = (request.getRequestURL()).toString().split("forgot_password")[0]; ...
api-misuse-repair-complete_data_275
private void handleOneStock(String code, StringBuilder sb, List<StockItem> items) { try { logger.info("Start to Handle stock : " + code); StockItem item = sinaStockIntegrationService.getStock(code); Stock stockTemp = stockService.getLast30Stock(code); List<StockItem> stockItems = stockTemp.getStockItems(); StockItem la...
api-misuse-repair-complete_data_276
@Override public boolean updateTournament(int id, Tournament tournament) { boolean updated = false; Connection conn = null; PreparedStatement ps = null; String sql = "UPDATE tournament SET tournament_name=?, start_date=?, end_date=?, location=?, " + "tournament_description=?, tournament_format_id=?, manager_id=? WHERE ...
api-misuse-repair-complete_data_277
public EventElection saveEvent(CMSMessage cmsMessage) throws Exception { MessagesVS messages = MessagesVS.getCurrentInstance(); User userSigner = cmsMessage.getUser(); EventVSDto request = cmsMessage.getSignedContent(EventVSDto.class); request.setDateFinish(DateUtils.resetDay(DateUtils.addDays(request.getDateBegin(), 1...
api-misuse-repair-complete_data_278
public static void main(String[] args) throws IOException, TasteException { Logger log = LoggerFactory.getLogger(UserbasedRecommender.class); DataModel model = new FileDataModel(new File("input/foody_rate.csv")); RecommenderBuilder builder = new RecommenderBuilder() { public Recommender buildRecommender(DataModel dataM...
api-misuse-repair-complete_data_279
public String getResponseInJson() { return new DefaultJsonBuilder().buildJson(response); } public String getResponseInJson() { return new DefaultJsonBuilder().build(response); }
api-misuse-repair-complete_data_280
@Override public void render(PipeFlowFluids flow, double x, double y, double z, float partialTicks, VertexBuffer vb) { FluidStack forRender = flow.getFluidStackForRender(); if (forRender == null) { return; } boolean[] sides = new boolean[6]; Arrays.fill(sides, true); double[] amounts = flow.getAmountsForRender(partialT...
api-misuse-repair-complete_data_281
@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.act_generatepubkey); cm = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); keyTypeGroup = (RadioGroup) findViewById(R.id.key_type); bitsText = (EditText) findViewById(R.id.bits); bitsSlider = (SeekBar) findVie...
api-misuse-repair-complete_data_282
private void updatePreference(Preference preference) { final SharedPreferences sharedPrefs = preference.getSharedPreferences(); String preferenceKey = preference.getKey(); if (preference instanceof RingtonePreference) { String ringtonePath = sharedPrefs.getString(preferenceKey, "NO_SOUND"); Uri ringtoneUri = Uri.parse(...
api-misuse-repair-complete_data_283
private ExportDeclaration exportDeclaration() { long begin = ts.beginPosition(); consume(Token.EXPORT); switch(token()) { case MUL: { consume(Token.MUL); String moduleSpecifier = fromClause(); semicolon(); addModuleRequest(moduleSpecifier); return new ExportDeclaration(begin, ts.endPosition(), moduleSpecifier); } case ...
api-misuse-repair-complete_data_284
@Override public CalendarDate getDateRemoved() { return new CalendarDate(_element.getFirstChildElement("dateFixed").getValue()); } @Override public CalendarDate getDateRemoved() { String d = _element.getFirstChildElement("dateFixed").getValue(); if (d.equals("")) { return new CalendarDate(); } else { return new Calen...
api-misuse-repair-complete_data_285
public int getDurationShortBreak() { return Integer.parseInt(sharedPrefs.getString("timerShortB", "30000")); } public int getDurationShortBreak() { return Integer.parseInt(sharedPrefs.getString("timerShortB", "300000")); }
api-misuse-repair-complete_data_286
public CalendarEvent mapRow(ResultSet rs, int rowNum) throws SQLException { CalendarEvent event = new CalendarEvent(); event.setId(rs.getString("id")); event.setTitle(rs.getString("event_name")); event.setStart(rs.getDate("event_date").toString()); event.setEnd(rs.getDate("event_date").toString()); event.setUrl(""); re...
api-misuse-repair-complete_data_287
public void setFileChooser(Stage stage) { final FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Aggiungi immagini"); fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); fileChooser.getExtensionFilters().addAll(new FileChooser.ExtensionFilter("All Images", "*.*"), new FileChoos...
api-misuse-repair-complete_data_288
public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("back")) { JBSCore.msgLogger.addMessage("Called Command: \"" + e.getActionCommand() + "\" on " + JBSOptionsPanel.this.getClass()); JBSOptionsPanel.this.parent.restorePrevContainer(); } } public void actionPerformed(ActionEvent e) { if (e.get...
api-misuse-repair-complete_data_289
public void propagerCase() { if (status == CASE_NOUVELLE) { List<Case> listeVoisins = new ArrayList(); List<Case> listePropagationVoisins = new ArrayList(); listeVoisins = grille.getVoisins(this); for (Case voisin : listeVoisins) { if (voisin.getBombe()) { this.value++; } } if (this.value == 0) { this.status = CASE_INU...
api-misuse-repair-complete_data_290
protected void doResults(SoapMessage msg, String actor, Element soapHeader, Element soapBody, WSHandlerResult wsResult, boolean utWithCallbacks) throws SOAPException, XMLStreamException, WSSecurityException { List<WSHandlerResult> results = CastUtils.cast((List<?>) msg.get(WSHandlerConstants.RECV_RESULTS)); if (results...
api-misuse-repair-complete_data_291
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletContext context = request.getServletContext(); DB = (DBConnection) context.getAttribute("DBConnection"); HttpSession session = request.getSession(); if (request.getParameter("Time") != null && re...
api-misuse-repair-complete_data_292
public String getType() { return types == null || types.isEmpty() ? null : String.join(" ", types); } public String getType() { return types == null || types.isEmpty() ? null : PlainSelect.getStringList(types, false, false); }
api-misuse-repair-complete_data_293
public String createSchemaForObject(JsonObject jsonObject, JsonSchema parent) { String elementIdentifierValue = null; String identifierKey = null; Set<Entry<String, JsonElement>> entrySet = jsonObject.entrySet(); for (Entry<String, JsonElement> entry : entrySet) { String id = entry.getKey(); if (id.startsWith(DOLLAR_PR...
api-misuse-repair-complete_data_294
public Match findBestMatch(Mat source, Mat template, int maxLevel) { List<Mat> references; List<Mat> tuples; List<Mat> results = new ArrayList<>(); references = buildPyramid(source, maxLevel); tuples = buildPyramid(template, maxLevel); Mat reference; Mat tuple; Mat result = new Mat(); for (int level = maxLevel; level >...
api-misuse-repair-complete_data_295
public String process(String srcString, String filename) { String desc = null; SourceStringReader reader = new SourceStringReader(split(srcString)); final ByteArrayOutputStream os; try { File outFile = new File(filename); FileFormat outFormat = FileFormat.PNG; if (outFile.toPath().endsWith(".svg")) { outFormat = FileFo...
api-misuse-repair-complete_data_296
public void initIndexWriter(String indexDirPath, int langage) throws IOException { File indexDir = new File(indexDirPath); log = LogFactory.getLog(this.getClass()); if (!indexDir.exists()) indexDir.createNewFile(); Analyzer luceneAnalyzer = null; if (langage == ENGLISH) luceneAnalyzer = new StandardAnalyzer(); else if ...
api-misuse-repair-complete_data_297
public InternationalString convertFrom(CharacterStringPropertyType stringP, Type<InternationalString> destType, MappingContext ctx) { return new SimpleInternationalString((String) stringP.getCharacterString().getValue()); } public InternationalString convertFrom(CharacterStringPropertyType property, Type<Internationa...
api-misuse-repair-complete_data_298
BaseAction replaceDoDialogActionWithOnDialogTreeChain(BaseAction a) { if (a instanceof ActivateDialogTreeModeAction) { int branchId = ((ActivateDialogTreeModeAction) a).getBranchId(); DialogChainableAction d = createDialogChainRootAction(); DialogChainEndAction b = this.sceneHandlers.onDialogTree(proxyForGameScene, d, ...
api-misuse-repair-complete_data_299
public void saveToPreferences() { SharedPreferences.Editor editor = preferences.edit(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { Set<String> alarms_s = new HashSet<String>(alarms.size()); int i = 0; for (PunchAlarmTime a : alarms) { long n = a.toLong(); alarms_s.add(Long.toHexString(n)); } editor.p...
api-misuse-repair-complete_data_300
@Override public void importStream(final InputStream stream, String importerName) { try { final FileImporter importer = controller.getFileImporter(importerName); if (importer == null) { NotifyDescriptor.Message msg = new NotifyDescriptor.Message(NbBundle.getMessage(getClass(), "DesktopImportControllerUI.error_no_matchi...