auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Map<String, DbParameterAccessor> readIntoParams(String objname, String query) throws SQLException { DbParameterAccessorsMapBuilder params = new DbParameterAccessorsMapBuilder(); objname = objname.replaceAll("[^a-zA-Z0-9_.#$]", ""); String currentDatabaseName; try (Statement s = currentConnection.createStatement()) { ResultSet rs = s.executeQuery("SELECT DB_NAME() AS x"); rs.next(); currentDatabaseName = rs.getString(1); } String objectDatabaseName; String[] objnameParts = objname.split("\\."); if (objnameParts.length == 3) { objectDatabaseName = objnameParts[0]; } else { objectDatabaseName = currentDatabaseName; } String bracketedName = enquoteAndJoin(objname.split("\\."), ".", "[", "]"); try (Statement s = currentConnection.createStatement()) { s.execute("USE " + objectDatabaseName); } try (PreparedStatement dc = currentConnection.prepareStatement(query)) { dc.setString(1, bracketedName); ResultSet rs = dc.executeQuery(); while (rs.next()) { String paramName = defaultIfNull(rs.getString(1), ""); params.add(paramName, getParameterDirection(rs.getInt(4), paramName), getSqlType(rs.getString(2)), getJavaClass(rs.getString(2))); } } try (Statement s = currentConnection.createStatement()) { s.execute("USE " + currentDatabaseName); } return params.toMap(); }

Target:
private Map<String, DbParameterAccessor> readIntoParams(String objname, String query) throws SQLException { DbParameterAccessorsMapBuilder params = new DbParameterAccessorsMapBuilder(); objname = objname.replaceAll("[^a-zA-Z0-9_.#$]", ""); String bracketedName = enquoteAndJoin(objname.split("\\."), ".", "[", "]"); try (PreparedStatement dc = currentConnection.prepareStatement(query)) { dc.setString(1, bracketedName); ResultSet rs = dc.executeQuery(); while (rs.next()) { String paramName = defaultIfNull(rs.getString(1), ""); params.add(paramName, getParameterDirection(rs.getInt(4), paramName), getSqlType(rs.getString(2)), getJavaClass(rs.getString(2))); } } return params.toMap(); }
Source:
protected List<?> mergeLists(List<?> source, List<?> values) { List<Object> data = new ArrayList<Object>(); for (Object value : values) { data.add(value); } if (source != null ) { for (Object value : source) { data.add(value); } } return data; }

Target:
protected List<?> mergeLists(List<?> source, List<?> values) { List<Object> data = new ArrayList<Object>(); data.addAll(values); if (source != null) { data.addAll(source); } return data; }
Source:
public static <P extends IProperty, V>IUnlistedProperty toUnlisted(P property) { return new PropertyAdapter(property); }

Target:
public static <P extends IProperty, V>IUnlistedProperty<V> toUnlisted(P property) { return new PropertyAdapter(property); }
Source:
public void close() { closePort(); }

Target:
public void close() { synchronized (portLock) { logger.info("Closing DSMR port"); isOpen = false; if (reader != null) { try { reader.close(); } catch (IOException ioe) { logger.debug("Failed to close reader", ioe); } } if (serialPort != null) { serialPort.close(); } reader = null; serialPort = null; } }
Source:
public Boolean call() { try { CallContext callContext = bulkInputCallerImpl.getCallContexts().poll(); if(callContext != null) bulkInputCallerImpl.processInput(callContext); if(getPhase() == WorkPhase.COMPLETED && bulkInputCallerImpl.getCallContexts().isEmpty()) { getCallerThreadPoolExecutor().shutdown(); } else if(callContext != null) { bulkInputCallerImpl.getCallContexts().put(callContext); submitTask(this); } } catch(Exception ex) { logger.error("Error occurred while processing CallContext - "+ex.getMessage()); return false; } return true; }

Target:
public Boolean call() { try { CallContext callContext = bulkInputCallerImpl.getCallContextQueue().poll(); if(callContext != null) bulkInputCallerImpl.processInput(callContext, inputBatch); if(getPhase() == WorkPhase.COMPLETED && bulkInputCallerImpl.getCallContextQueue().isEmpty()) { getCallerThreadPoolExecutor().shutdown(); } else if(callContext != null) { bulkInputCallerImpl.getCallContextQueue().put(callContext); } } catch(Exception ex) { throw new InternalError("Error occurred while processing CallContext - "+ex.getMessage()); } return true; }
Source:
public Optional<DyeableData> from(DataHolder dataHolder) { if (supports(dataHolder)) { return Optional.ofNullable(((IMixinTileEntityShulkerBox) dataHolder).getColor()) .map(enumType -> (DyeColor) (Object) enumType) .map(SpongeDyeableData::new); } return Optional.empty(); }

Target:
public Optional<DyeableData> from(DataHolder dataHolder) { EnumDyeColor enumType = ((IMixinTileEntityShulkerBox) dataHolder).getColor(); if (enumType != null) { return Optional.of(new SpongeDyeableData((DyeColor) (Object) enumType)); } return Optional.empty(); }
Source:
protected void executeCommand() { VDSGroup vdsGroup = getVdsGroupDao().get(vds.getVdsGroupId()); if (vdsGroup != null) { getReturnValue().setSucceeded(runUpdateMomPolicy(vds, vdsGroup.isEnableBallooning())); } }

Target:
protected void executeCommand() { getReturnValue().setSucceeded(runUpdateMomPolicy(vds, getVdsGroup().isEnableBallooning())); }
Source:
protected final void onOpen(final SocketSession conn) { if (getConnectionToId().size() >= MAX_CONNECTIONS) { LOG.info("FULL SERVER"); conn.close(STATE_SERVER_FULL, FULL_SERVER_MESSAGE); } final MultiConnectionState uniqueState = getUniqueState(); connectionToId.put(conn, uniqueState); idToConnection.put(uniqueState, conn); LOG.info("Session Key {}", uniqueState.getKey()); idToState.put(uniqueState.getKey(), uniqueState); LOG.info("ID ASSIGNED"); LOG.info("Recieving connection {}", getConnectionToId().size()); openSession(conn); }

Target:
protected final void onOpen(final SocketSession conn) { if (getConnectionToId().size() >= MAX_CONNECTIONS) { LOG.info("FULL SERVER"); conn.close(STATE_SERVER_FULL, FULL_SERVER_MESSAGE); } final MultiConnectionState uniqueState = getUniqueState(); connectionToId.put(conn, uniqueState); idToConnection.put(uniqueState, conn); LOG.debug("Session Key {}", uniqueState.getKey()); idToState.put(uniqueState.getKey(), uniqueState); LOG.info("ID ASSIGNED"); LOG.info("Recieving connection {}", getConnectionToId().size()); openSession(conn); }
Source:
public void search_users_filter_by_organization_uuid() { esTester.putDocuments(INDEX_TYPE_USER.getIndex(), INDEX_TYPE_USER.getType(), newUser(USER1_LOGIN, asList("user_1", "u1")).setEmail("email1") .setOrganizationUuids(newArrayList("O1", "O2"))); esTester.putDocuments(INDEX_TYPE_USER.getIndex(), INDEX_TYPE_USER.getType(), newUser(USER2_LOGIN, emptyList()).setEmail("email2") .setOrganizationUuids(newArrayList("O2"))); assertThat(underTest.search(userQuery.setOrganizationUuid("O42").build(), new SearchOptions()).getDocs()).isEmpty(); assertThat(underTest.search(userQuery.setOrganizationUuid("O2").build(), new SearchOptions()).getDocs()).hasSize(2); assertThat(underTest.search(userQuery.setOrganizationUuid("O1").build(), new SearchOptions()).getDocs()).hasSize(1); }

Target:
public void search_users_filter_by_organization_uuid() { esTester.putDocuments(INDEX_TYPE_USER.getIndex(), INDEX_TYPE_USER.getType(), newUser(USER1_LOGIN, asList("user_1", "u1")).setEmail("email1") .setOrganizationUuids(newArrayList("O1", "O2"))); esTester.putDocuments(INDEX_TYPE_USER.getIndex(), INDEX_TYPE_USER.getType(), newUser(USER2_LOGIN, emptyList()).setEmail("email2") .setOrganizationUuids(newArrayList("O2"))); assertThat(underTest.search(userQuery.setOrganizationUuid("O42").build(), new SearchOptions()).getDocs()).isEmpty(); assertThat(underTest.search(userQuery.setOrganizationUuid("O2").build(), new SearchOptions()).getDocs()).extracting(UserDoc::login).containsOnly(USER1_LOGIN, USER2_LOGIN); assertThat(underTest.search(userQuery.setOrganizationUuid("O1").build(), new SearchOptions()).getDocs()).extracting(UserDoc::login).containsOnly(USER1_LOGIN); }
Source:
private Coords getEjectPosition(Entity abandoned) { Coords pos = abandoned.getPosition(); Entity crew = new EjectedCrew(); crew.setId(clientgui.getClient().getGame().getNextEntityId()); crew.setGame(clientgui.getClient().getGame()); int elev = clientgui.getClient().getGame().getBoard().getHex(pos).getLevel() + abandoned.getElevation(); ArrayList<Coords> ring = Compute.coordsAtRange(pos, 1); if (abandoned instanceof Dropship) { ring = Compute.coordsAtRange(pos, 2); } ring = Compute.getAcceptableUnloadPositions(ring, crew, clientgui .getClient().getGame(), elev); if (ring.size() < 1) { String title = Messages .getString("MovementDisplay.NoPlaceToEject.title"); String body = Messages .getString("MovementDisplay.NoPlaceToEject.message"); clientgui.doAlertDialog(title, body); return null; } String[] choices = new String[ring.size()]; int i = 0; for (Coords c : ring) { choices[i++] = c.toString(); } String selected = (String) JOptionPane.showInputDialog(clientgui, Messages.getString( "MovementDisplay.ChooseEjectHex" + ".message", new Object[]{ abandoned.getShortName(), abandoned.getUnusedString()}), Messages .getString("MovementDisplay.ChooseHex.title"), JOptionPane.QUESTION_MESSAGE, null, choices, null); Coords choice = null; if (selected == null) { return choice; } for (Coords c : ring) { if (selected.equals(c.toString())) { choice = c; break; } } return choice; }

Target:
private Coords getEjectPosition(Entity abandoned) { Coords pos = abandoned.getPosition(); Entity crew = new EjectedCrew(); crew.setId(clientgui.getClient().getGame().getNextEntityId()); crew.setGame(clientgui.getClient().getGame()); int elev = clientgui.getClient().getGame().getBoard().getHex(pos).getLevel() + abandoned.getElevation(); ArrayList<Coords> ring = Compute.coordsAtRange(pos, 1); if (abandoned instanceof Dropship) { ring = Compute.coordsAtRange(pos, 2); } ring = Compute.getAcceptableUnloadPositions(ring, crew, clientgui .getClient().getGame(), elev); if (ring.size() < 1) { String title = Messages .getString("MovementDisplay.NoPlaceToEject.title"); String body = Messages .getString("MovementDisplay.NoPlaceToEject.message"); clientgui.doAlertDialog(title, body); return null; } String[] choices = new String[ring.size()]; int i = 0; for (Coords c : ring) { choices[i++] = c.toString(); } String selected = (String) JOptionPane.showInputDialog(clientgui, Messages.getString( "MovementDisplay.ChooseEjectHex.message", new Object[]{ abandoned.getShortName(), abandoned.getUnusedString()}), Messages .getString("MovementDisplay.ChooseHex.title"), JOptionPane.QUESTION_MESSAGE, null, choices, null); Coords choice = null; if (selected == null) { return choice; } for (Coords c : ring) { if (selected.equals(c.toString())) { choice = c; break; } } return choice; }
Source:
public void start() throws IOException { logger.info("Starting Communication Channel on " + address + " at " + port); socket = socketFactory.createSocket(address, port); socket.setSoTimeout(blockingReadTimeout); reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), Charset.forName("UTF-8"))); writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), Charset.forName("UTF-8"))); if (authToken != null) { writer.write(authToken); writer.write("\n"); writer.flush(); String reply = reader.readLine(); if (reply == null || !reply.equals(Protocol.getOutputSuccessCommand().trim())) { shutdown(true); throw new IOException("Authentication with callback server unsuccessful."); } } }

Target:
public void start() throws IOException { logger.info("Starting Communication Channel on " + address + " at " + port); socket = socketFactory.createSocket(address, port); socket.setSoTimeout(blockingReadTimeout); reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), Charset.forName("UTF-8"))); writer = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), Charset.forName("UTF-8"))); if (authToken != null) { try { NetworkUtil.authToServer(reader, writer, authToken); } catch (IOException ioe) { shutdown(true); throw ioe; } } }
Source:
public String showProject(Model model, @ProjectIdentifier @PathVariable("ProjectUnixName") String unixName, Principal principal, @CheckAccess @InjectProject IProject project) throws QuadrigaStorageException { String projectId = project.getProjectId(); Integer count = 1; model.addAttribute("project_baseurl", env.getProperty("project.cite.baseurl")); List<IPublicPage> publicPages = publicPageManager.retrievePublicPageContent(project.getProjectId()); Collections.sort(publicPages, new Comparator<IPublicPage>() { @Override public int compare(IPublicPage o1, IPublicPage o2) { return o1.getOrder() - o2.getOrder(); } }); Map<String, String> linkToMap = getLinkTargetMap(); publicPages.forEach(item -> item.setLinkTo(linkToMap.get(item.getLinkTo()))); List<IProjectBlogEntry> latestProjectBlogEntryList = projectBlogEntryManager.getProjectBlogEntryList(projectId, count); if (latestProjectBlogEntryList.size() > 0 ) { model.addAttribute("latestProjectBlogEntry", latestProjectBlogEntryList.get(0)); model.addAttribute("latestProjectBlogEntrySnippet",latestProjectBlogEntryList.get(0).getSnippet(WORD_COUNT)); } model.addAttribute("blocks", publicPages); model.addAttribute("project", project); return "sites/website"; }

Target:
public String showProject(Model model, @ProjectIdentifier @PathVariable("ProjectUnixName") String unixName, Principal principal, @CheckAccess @InjectProject IProject project) throws QuadrigaStorageException { model.addAttribute("project_baseurl", env.getProperty("project.cite.baseurl")); List<IPublicPage> publicPages = publicPageManager.retrievePublicPageContent(project.getProjectId()); Collections.sort(publicPages, new Comparator<IPublicPage>() { @Override public int compare(IPublicPage o1, IPublicPage o2) { return o1.getOrder() - o2.getOrder(); } }); Map<String, String> linkToMap = getLinkTargetMap(); publicPages.forEach(item -> item.setLinkTo(linkToMap.get(item.getLinkTo()))); List<IProjectBlogEntry> latestProjectBlogEntryList = projectBlogEntryManager.getProjectBlogEntryList(project.getProjectId(), 1); if (latestProjectBlogEntryList.size() > 0 ) { model.addAttribute("latestProjectBlogEntry", latestProjectBlogEntryList.get(0)); model.addAttribute("latestProjectBlogEntrySnippet",latestProjectBlogEntryList.get(0).getSnippet(WORD_COUNT)); } model.addAttribute("blocks", publicPages); model.addAttribute("project", project); return "sites/website"; }
Source:
public String[] getIcons(String os) { String[] icons = defaults.getIcons(os); logger.debug("Getting the follwing icon path from defaults: " + Arrays.toString(icons)); for (int i = 0; i < icons.length; i++) { icons[i] = guessRealIconPath(icons[i]); } return icons; }

Target:
public String[] getIcons(String os) { String[] icons = defaults.getIcons(os); logger.debug("Getting the following icon paths from defaults: " + Arrays.toString(icons)); for (int i = 0; i < icons.length; i++) { icons[i] = guessRealIconPath(icons[i]); } return icons; }
Source:
private void updateMtuSizeSettings(NetworkStateTracker nt) { final String thisIface = nt.getLinkProperties().getInterfaceName(); int mtu = mContext.getResources().getInteger( com.android.internal.R.integer.config_mtu_size); try { if (VDBG) log("Setting MTU size: " + thisIface + ", " + mtu); mNetd.setMtu(thisIface, mtu); } catch (Exception e) { Slog.e(TAG, "exception in setMtu()" + e); } }

Target:
private void updateMtuSizeSettings(NetworkStateTracker nt) { final String iface = nt.getLinkProperties().getInterfaceName(); final int mtu = nt.getLinkProperties().getMtu(); try { if (VDBG) log("Setting MTU size: " + iface + ", " + mtu); mNetd.setMtu(iface, mtu); } catch (Exception e) { Slog.e(TAG, "exception in setMtu()" + e); } }
Source:
public Observable<DeleteResult> asRxObservable() { throwExceptionIfRxJavaIsNotAvailable("asRxObservable()"); final Observable<DeleteResult> observable = Observable.create(OnSubscribeExecuteAsBlocking.newInstance(this)); return RxJavaUtils.subscribeOn(observable, storIOContentResolver); }

Target:
public Observable<DeleteResult> asRxObservable() { return RxJavaUtils.createObservable(storIOContentResolver, this); }
Source:
private void testSetUpForRunningFlows() throws Exception { this.loader = mock(ExecutorLoader.class); this.apiGateway = mock(ExecutorApiGateway.class); this.user = TestUtils.getTestUser(); this.props.put(ExecutorManager.AZKABAN_USE_MULTIPLE_EXECUTORS, "true"); this.props.put(ExecutorManager.AZKABAN_QUEUEPROCESSING_ENABLED, "true"); this.props.put("azkaban.max.concurrent.runs.oneflow", 2); final List<Executor> executors = new ArrayList<>(); final Executor executor1 = new Executor(1, "localhost", 12345, true); final Executor executor2 = new Executor(2, "localhost", 12346, true); executors.add(executor1); executors.add(executor2); when(this.loader.fetchActiveExecutors()).thenReturn(executors); this.manager = createExecutorManager(); this.flow1 = TestUtils.createTestExecutableFlow("exectest1", "exec1"); this.flow2 = TestUtils.createTestExecutableFlow("exectest1", "exec2"); this.flow1.setExecutionId(1); this.flow2.setExecutionId(2); final ExecutionReference ref1 = new ExecutionReference(this.flow1.getExecutionId(), executor1); final ExecutionReference ref2 = new ExecutionReference(this.flow2.getExecutionId(), executor2); this.activeFlows.put(this.flow1.getExecutionId(), new Pair<>(ref1, this.flow1)); this.activeFlows.put(this.flow2.getExecutionId(), new Pair<>(ref2, this.flow2)); when(this.loader.fetchActiveFlows()).thenReturn(this.activeFlows); }

Target:
private void testSetUpForRunningFlows() throws Exception { this.loader = mock(ExecutorLoader.class); this.apiGateway = mock(ExecutorApiGateway.class); this.user = TestUtils.getTestUser(); this.props.put(ExecutorManager.AZKABAN_USE_MULTIPLE_EXECUTORS, "true"); this.props.put(ExecutorManager.AZKABAN_QUEUEPROCESSING_ENABLED, "true"); this.props.put(ExecutorManager.AZKABAN_MAX_CONCURRENT_RUNS_ONEFLOW, 2); final List<Executor> executors = new ArrayList<>(); final Executor executor1 = new Executor(1, "localhost", 12345, true); final Executor executor2 = new Executor(2, "localhost", 12346, true); executors.add(executor1); executors.add(executor2); when(this.loader.fetchActiveExecutors()).thenReturn(executors); this.manager = createExecutorManager(); this.flow1 = TestUtils.createTestExecutableFlow("exectest1", "exec1"); this.flow2 = TestUtils.createTestExecutableFlow("exectest1", "exec2"); this.flow1.setExecutionId(1); this.flow2.setExecutionId(2); final ExecutionReference ref1 = new ExecutionReference(this.flow1.getExecutionId(), executor1); final ExecutionReference ref2 = new ExecutionReference(this.flow2.getExecutionId(), executor2); this.activeFlows.put(this.flow1.getExecutionId(), new Pair<>(ref1, this.flow1)); this.activeFlows.put(this.flow2.getExecutionId(), new Pair<>(ref2, this.flow2)); when(this.loader.fetchActiveFlows()).thenReturn(this.activeFlows); }
Source:
public void run() { Timer.Context docTimer = vcrMetrics.blobCompactionTime.time(); try { compactPartitions(); } finally { docTimer.stop(); } }

Target:
public void run() { Timer.Context timer = vcrMetrics.blobCompactionTime.time(); try { compactPartitions(); } catch (Throwable th) { logger.error("Hit exception running compaction task", th); } finally { timer.stop(); } }
Source:
private Answer executeRequest(ReserveVmInterfaceVspCommand cmd) { try { isNuageVspGuruLoaded(); _nuageVspGuruClient.reserve(cmd.getNicUuid(), cmd.getNicMacAddress(), cmd.getNetworkUuid(), cmd.isL3Network(), cmd.isSharedNetwork(), cmd.getVpcUuid(), cmd.getNetworkDomainUuid(), cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), cmd.getDomainRouterIp(), cmd.getVmInstanceName(), cmd.getVmUuid(), cmd.useStaticIp(), cmd.getStaticIp(), cmd.getStaticNatIpUuid(), cmd.getStaticNatIpAddress(), cmd.isStaticNatIpAllocated(), cmd.isOneToOneNat(), cmd.getStaticNatVlanUuid(), cmd.getStaticNatVlanGateway(), cmd.getStaticNatVlanNetmask()); return new ReserveVmInterfaceVspAnswer(cmd, "Created NIC in VSP that maps to nicUuid" + cmd.getNicUuid()); } catch (Exception e) { s_logger.error("Failure during " + cmd, e); return new ReserveVmInterfaceVspAnswer(cmd, e); } }

Target:
private Answer executeRequest(ReserveVmInterfaceVspCommand cmd) { try { isNuageVspGuruLoaded(); _nuageVspGuruClient.reserve(cmd.getNicUuid(), cmd.getNicMacAddress(), cmd.getNetworkUuid(), cmd.isL3Network(), cmd.isSharedNetwork(), cmd.getVpcUuid(), cmd.getNetworkDomainUuid(), cmd.getNetworksAccountUuid(), cmd.isDomainRouter(), cmd.getDomainRouterIp(), cmd.getVmInstanceName(), cmd.getVmUuid(), cmd.useStaticIp(), cmd.getStaticIp(), cmd.getStaticNatIpUuid(), cmd.getStaticNatIpAddress(), cmd.isStaticNatIpAllocated(), cmd.isOneToOneNat(), cmd.getStaticNatVlanUuid(), cmd.getStaticNatVlanGateway(), cmd.getStaticNatVlanNetmask()); return new Answer(cmd, true, "Created NIC that maps to nicUuid" + cmd.getNicUuid() + " on Nuage VSD " + _hostName); } catch (ExecutionException | ConfigurationException e) { s_logger.error("Failure during " + cmd + " on Nuage VSD " + _hostName, e); return new Answer(cmd, e); } }
Source:
public void testSTMin() throws Exception { assertQuery("select ST_XMin(ST_GeometryFromText('LineString(8 4, 5 7)'))", "select 5.0"); assertQuery("select ST_YMin(ST_GeometryFromText('LineString(8 4, 5 7)'))", "select 4.0"); assertQuery("select ST_XMin(ST_GeometryFromText('Polygon ((2 0, 2 1, 3 1))'))", "select 2.0"); assertQuery("select ST_YMin(ST_GeometryFromText('Polygon ((2 0, 2 1, 3 1))'))", "select 0.0"); }

Target:
public void testSTMin() throws Exception { assertFunction("ST_XMin(ST_GeometryFromText('POINT (1.5 2.5)'))", DOUBLE, 1.5); assertFunction("ST_YMin(ST_GeometryFromText('POINT (1.5 2.5)'))", DOUBLE, 2.5); assertFunction("ST_XMin(ST_GeometryFromText('MULTIPOINT (1 2, 2 4, 3 6, 4 8)'))", DOUBLE, 1.0); assertFunction("ST_YMin(ST_GeometryFromText('MULTIPOINT (1 2, 2 4, 3 6, 4 8)'))", DOUBLE, 2.0); assertFunction("ST_XMin(ST_GeometryFromText('LINESTRING (8 4, 5 7)'))", DOUBLE, 5.0); assertFunction("ST_YMin(ST_GeometryFromText('LINESTRING (8 4, 5 7)'))", DOUBLE, 4.0); assertFunction("ST_XMin(ST_GeometryFromText('MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))'))", DOUBLE, 1.0); assertFunction("ST_YMin(ST_GeometryFromText('MULTILINESTRING ((1 2, 5 3), (2 4, 4 4))'))", DOUBLE, 2.0); assertFunction("ST_XMin(ST_GeometryFromText('POLYGON ((2 0, 2 1, 3 1))'))", DOUBLE, 2.0); assertFunction("ST_YMin(ST_GeometryFromText('POLYGON ((2 0, 2 1, 3 1))'))", DOUBLE, 0.0); assertFunction("ST_XMin(ST_GeometryFromText('MULTIPOLYGON (((1 10, 1 3, 3 3, 3 10)), ((2 4, 2 6, 6 6, 6 4)))'))", DOUBLE, 1.0); assertFunction("ST_YMin(ST_GeometryFromText('MULTIPOLYGON (((1 10, 1 3, 3 3, 3 10)), ((2 4, 2 6, 6 10, 6 4)))'))", DOUBLE, 3.0); }
Source:
public void layoutTopRight(CTabFolder ctf) { Composite trComp = getTRComposite(ctf); if (trComp.getChildren().length > 0) { trComp.setVisible(true); ctf.setTopRight(trComp, SWT.RIGHT | SWT.WRAP); } else { ctf.setTopRight(null); trComp.setVisible(false); } trComp.pack(); ctf.layout(true, true); }

Target:
public void layoutTopRight(CTabFolder ctf) { Composite trComp = getTRComposite(ctf); if (trComp.getChildren().length > 0) { trComp.setVisible(true); ctf.setTopRight(trComp, SWT.RIGHT | SWT.WRAP); } else { ctf.setTopRight(null); trComp.setVisible(false); } trComp.pack(); trComp.layout(true, true); }
Source:
protected void setOutput(String executionId, Serializable output) { if (isAsync(executionId)) { Serializable commandId = output instanceof AsyncStatus ? ((AsyncStatus) output).getCommandId() : output; getTransientStore().putParameter(executionId, TRANSIENT_STORE_COMMAND_ID, commandId); } else { if (output instanceof DocumentModel) { output = detach((DocumentModel) output); } else if (output instanceof DocumentModelList) { output = new DocumentModelListImpl( ((DocumentModelList) output).stream().map(this::detach).collect(Collectors.toList())); } if (output instanceof Blob) { getTransientStore().putParameter(executionId, TRANSIENT_STORE_OUTPUT_BLOB, true); getTransientStore().putBlobs(executionId, Collections.singletonList((Blob) output)); } else if (output instanceof BlobList) { getTransientStore().putParameter(executionId, TRANSIENT_STORE_OUTPUT_BLOB, false); getTransientStore().putBlobs(executionId, (BlobList) output); } else { getTransientStore().putParameter(executionId, TRANSIENT_STORE_OUTPUT, output); } } }

Target:
protected void setOutput(String executionId, Serializable output) { TransientStore ts = getTransientStore(); if (isAsync(executionId)) { Serializable taskId = output instanceof AsyncStatus ? ((AsyncStatus) output).getId() : output; ts.putParameter(executionId, TRANSIENT_STORE_TASK_ID, taskId); } else { if (output instanceof DocumentModel) { detach((DocumentModel) output); } else if (output instanceof DocumentModelList) { ((DocumentModelList) output).forEach(this::detach); } if (output instanceof Blob) { ts.putParameter(executionId, TRANSIENT_STORE_OUTPUT_BLOB, true); ts.putBlobs(executionId, Collections.singletonList((Blob) output)); } else if (output instanceof BlobList) { ts.putParameter(executionId, TRANSIENT_STORE_OUTPUT_BLOB, false); ts.putBlobs(executionId, (BlobList) output); } else { ts.putParameter(executionId, TRANSIENT_STORE_OUTPUT, output); } } }
Source:
public String getSourceForUnaryTest(String packageName, String className, String input, DMNCompilerContext ctx, Type columntype) { Map<String, Type> variableTypes = new HashMap<>(); for ( Map.Entry<String, DMNType> entry : ctx.getVariables().entrySet() ) { variableTypes.put(entry.getKey(), dmnToFeelType((BaseDMNTypeImpl) entry.getValue())); } variableTypes.put( "?", columntype ); FEEL_1_1Parser parser = FEELParser.parse( null, input, variableTypes, Collections.emptyMap(), feel.getCustomFunctions(), Collections.emptyList()); FEEL_1_1Parser.ExpressionListContext tree = parser.expressionList(); DirectCompilerVisitor v = new DirectCompilerVisitor(variableTypes); DirectCompilerResult result = v.compileUnaryTests(tree); return new CompilerBytecodeLoader().getSourceForUnaryTest(packageName, className, input, result); }

Target:
public String getSourceForUnaryTest(String packageName, String className, String input, DMNCompilerContext ctx, Type columntype) { Map<String, Type> variableTypes = new HashMap<>(); for ( Map.Entry<String, DMNType> entry : ctx.getVariables().entrySet() ) { variableTypes.put(entry.getKey(), dmnToFeelType((BaseDMNTypeImpl) entry.getValue())); } variableTypes.put( "?", columntype ); FEEL_1_1Parser parser = FEELParser.parse(null, input, variableTypes, Collections.emptyMap(), feel.getCustomFunctions(), Collections.emptyList()); FEEL_1_1Parser.ExpressionListContext tree = parser.expressionList(); UnaryCompilerVisitor v = new UnaryCompilerVisitor(variableTypes); DirectCompilerResult result = v.compileUnaryTests(tree); return new CompilerBytecodeLoader().getSourceForUnaryTest(packageName, className, input, result); }
Source:
private void setData() { LineData data = new LineData(); if (graphCheckboxGlucose.isChecked()) { data = generateGlucoseData(); } if (graphCheckboxA1c.isChecked()) { data = generateA1cData(); } if (graphCheckboxKetones.isChecked()) { data = generateKetonesData(); } if (graphCheckboxWeight.isChecked()) { data = generateWeightData(); } if (graphCheckboxPressure.isChecked()) { data = generatePressureData(); } if (graphCheckboxCholesterol.isChecked()) { data = generateCholesterolData(); } if (data.getEntryCount()!=0) { chart.setData(data); } else { chart.setData(null); } Log.e("glucosio", "DATA2 is " + data.getEntryCount()); chart.setPinchZoom(true); chart.setHardwareAccelerationEnabled(true); chart.setNoDataTextColor(getResources().getColor(R.color.glucosio_text)); chart.animateY(1000, Easing.EasingOption.EaseOutCubic); chart.invalidate(); chart.notifyDataSetChanged(); chart.fitScreen(); chart.setDescription(null); chart.setVisibleXRangeMaximum(20); chart.moveViewToX(data.getXMax()); Log.e("glucosio", "Size is: " + xValues.size()); XAxis xAxis = chart.getXAxis(); xAxis.setValueFormatter(null); final LineData finalData = data; IAxisValueFormatter formatter = new IAxisValueFormatter() { @Override public String getFormattedValue(float value, AxisBase axis) { Log.e("glucosio", "Values is " + value + "; Size is: " + xValues.size()); if (value < xValues.size() && value > 0) { return xValues.get((int) value); } else { return ""; } } }; xAxis.setGranularity(1f); xAxis.setValueFormatter(formatter); }

Target:
private void setData() { LineData data = new LineData(); if (graphCheckboxGlucose.isChecked()) { data = generateGlucoseData(); } if (graphCheckboxA1c.isChecked()) { data = generateA1cData(); } if (graphCheckboxKetones.isChecked()) { data = generateKetonesData(); } if (graphCheckboxWeight.isChecked()) { data = generateWeightData(); } if (graphCheckboxPressure.isChecked()) { data = generatePressureData(); } if (graphCheckboxCholesterol.isChecked()) { data = generateCholesterolData(); } if (data.getEntryCount()!=0) { chart.setData(data); } else { chart.setData(null); } chart.setPinchZoom(true); chart.setHardwareAccelerationEnabled(true); chart.setNoDataTextColor(getResources().getColor(R.color.glucosio_text)); chart.animateY(1000, Easing.EasingOption.EaseOutCubic); chart.invalidate(); chart.notifyDataSetChanged(); chart.fitScreen(); chart.setDescription(null); chart.setVisibleXRangeMaximum(20); chart.moveViewToX(data.getXMax()); XAxis xAxis = chart.getXAxis(); final LineData finalData = data; IAxisValueFormatter formatter = new IAxisValueFormatter() { @Override public String getFormattedValue(float value, AxisBase axis) { if (value < xValues.size() && value > 0) { return xValues.get((int) value); } else { return ""; } } }; xAxis.setGranularity(1f); xAxis.setValueFormatter(formatter); }
Source:
public void addClickHandler(ClickHandler clickHandler) { tabListItem.addClickHandler(clickHandler); }

Target:
public HandlerRegistration addClickHandler(ClickHandler clickHandler) { return tabListItem.addClickHandler(clickHandler); }
Source:
@Override public Object call() throws Exception { List<Thread> threadList = new ArrayList<>(); final CyclicBarrier b1 = new CyclicBarrier(4); final CyclicBarrier b2 = new CyclicBarrier(5); for (int i = 0; i < 4; i++) { final int ii = i; Thread thread = new Thread(new Runnable() { @Override public void run() { try { b1.await(); if (ii % 2 == 0) ign.configuration().getMarshaller().unmarshal(one, Thread.currentThread().getContextClassLoader()); else ign.configuration().getMarshaller().unmarshal(two, Thread.currentThread().getContextClassLoader()); b2.await(); } catch (Exception e) { e.printStackTrace(); } } }); thread.start(); threadList.add(thread); } try { b2.await(5, TimeUnit.SECONDS); } catch (TimeoutException te) { throw new IllegalStateException("Failed to wait for completion", te); } for (Thread thread : threadList) thread.join(); return null; }

Target:
@Override public Object call() throws Exception { ExecutorService executor = Executors.newFixedThreadPool(2); final CyclicBarrier start = new CyclicBarrier(2); for (int i = 0; i < 2; i++) { final int ii = i; executor.execute(new Runnable() { @Override public void run() { try { start.await(); if (ii == 0) ign.configuration().getMarshaller().unmarshal(one, null); else ign.configuration().getMarshaller().unmarshal(two, null); } catch (Exception e) { e.printStackTrace(); } } }); } try { executor.shutdown(); executor.awaitTermination(5, TimeUnit.SECONDS); if (!executor.isTerminated()) throw new IllegalStateException("Failed to wait for completion"); } catch (Exception te) { throw new IllegalStateException("Failed to wait for completion", te); } return null; }
Source:
public void loadMethod( ScriptBasedSessionManagementMethod method, String scriptName, List<String> paramValuesS) { if (scriptName != null) { ScriptWrapper script = getScriptsExtension().getScript(scriptName); if (script == null) { log.error( "Unable to find script while loading Script Based Session Management Method for name: " + scriptName); if (View.isInitialised()) { View.getSingleton() .showMessageDialog( Constant.messages.getString( "session.method.script.load.errorScriptNotFound", scriptName)); } return; } log.info("Loaded script:" + script.getName()); method.script = script; SessionScript s = getScriptInterface(script); if (s == null) { log.error( "Unable to load Script Based Session Management method. The script " + scriptName + " does not properly implement the Session Management Script interface."); return; } } Map<String, String> paramValues = null; if (paramValuesS != null && paramValuesS.size() > 0) { paramValues = EncodingUtils.stringToMap(paramValuesS.get(0)); method.paramValues = paramValues; } else { method.paramValues = new HashMap<String, String>(); log.error( "Unable to load script parameter values loading Script Based Session Management Method for name: " + scriptName); } }

Target:
private void loadMethod( ScriptBasedSessionManagementMethod method, String scriptName, List<String> paramValuesS) { if (scriptName != null) { ScriptWrapper script = getScriptsExtension().getScript(scriptName); if (script == null) { LOG.error( "Unable to find script while loading Script Based Session Management Method for name: " + scriptName); if (View.isInitialised()) { View.getSingleton() .showMessageDialog( Constant.messages.getString( "session.method.script.load.errorScriptNotFound", scriptName)); } return; } LOG.info("Loaded script:" + script.getName()); method.script = script; SessionScript s = getScriptInterface(script); if (s == null) { LOG.error( "Unable to load Script Based Session Management method. The script " + scriptName + " does not properly implement the Session Management Script interface."); return; } } Map<String, String> paramValues = null; if (paramValuesS != null && paramValuesS.size() > 0) { paramValues = EncodingUtils.stringToMap(paramValuesS.get(0)); method.paramValues = paramValues; } else { method.paramValues = new HashMap<String, String>(); LOG.error( "Unable to load script parameter values loading Script Based Session Management Method for name: " + scriptName); } }
Source:
public <T extends Enum> Converter<String, T> getConverter(Class<T> targetType) { Class<?> enumType = targetType; while (enumType != null && !enumType.isEnum()) { enumType = enumType.getSuperclass(); } Assert.notNull(enumType, "The target type " + targetType.getName() + " does not refer to an enum"); return new StringToEnum(enumType); }

Target:
public <T extends Enum> Converter<String, T> getConverter(Class<T> targetType) { Assert.notNull(targetType, "The target type must not be null."); Class<?> enumType = targetType; while (enumType != null && !enumType.isEnum()) { enumType = enumType.getSuperclass(); } Assert.notNull(enumType, "The target type " + targetType.getName() + " does not refer to an enum"); return new StringToEnum(enumType); }
Source:
default void startLogcatBroadcast() { URL remoteAdress = ((RemoteWebDriver) this).getRemoteAddress(); this.startLogcatBroadcast(remoteAdress.getHost(), remoteAdress.getPort()); }

Target:
default void startLogcatBroadcast() { URL remoteAddress = ((AppiumDriver) this).getRemoteAddress(); this.startLogcatBroadcast(remoteAddress.getHost(), remoteAddress.getPort()); }
Source:
private static SecurityPlan createSecurityPlan( BoltServerAddress address, Config config ) throws GeneralSecurityException, IOException { Config.EncryptionLevel encryptionLevel = config.encryptionLevel(); boolean requiresEncryption = encryptionLevel.equals( REQUIRED ); if ( requiresEncryption ) { Logger logger = config.logging().getLog( "session" ); switch ( config.trustStrategy().strategy() ) { case TRUST_ON_FIRST_USE: logger.warn( "Option `TRUST_ON_FIRST_USE` has been deprecated and will be removed in a future " + "version of the driver. Please switch to use `TRUST_ALL_CERTIFICATES` instead." ); return SecurityPlan.forTrustOnFirstUse( config.trustStrategy().certFile(), address, logger ); case TRUST_SIGNED_CERTIFICATES: logger.warn( "Option `TRUST_SIGNED_CERTIFICATE` has been deprecated and will be removed in a future " + "version of the driver. Please switch to use `TRUST_CUSTOM_CA_SIGNED_CERTIFICATES` instead." ); END OF DEPRECATED CASES case TRUST_ALL_CERTIFICATES: return SecurityPlan.forAllCertificates(); case TRUST_CUSTOM_CA_SIGNED_CERTIFICATES: return SecurityPlan.forCustomCASignedCertificates( config.trustStrategy().certFile() ); case TRUST_SYSTEM_CA_SIGNED_CERTIFICATES: return SecurityPlan.forSystemCASignedCertificates(); default: throw new ClientException( "Unknown TLS authentication strategy: " + config.trustStrategy().strategy().name() ); } } else { return insecure(); } }

Target:
private static SecurityPlan createSecurityPlan( BoltServerAddress address, Config config ) throws GeneralSecurityException, IOException { Config.EncryptionLevel encryptionLevel = config.encryptionLevel(); boolean requiresEncryption = encryptionLevel.equals( REQUIRED ); if ( requiresEncryption ) { Logger logger = config.logging().getLog( "session" ); switch ( config.trustStrategy().strategy() ) { case TRUST_ON_FIRST_USE: logger.warn( "Option `TRUST_ON_FIRST_USE` has been deprecated and will be removed in a future " + "version of the driver. Please switch to use `TRUST_ALL_CERTIFICATES` instead." ); return SecurityPlan.forTrustOnFirstUse( config.trustStrategy().certFile(), address, logger ); case TRUST_SIGNED_CERTIFICATES: logger.warn( "Option `TRUST_SIGNED_CERTIFICATE` has been deprecated and will be removed in a future " + "version of the driver. Please switch to use `TRUST_CUSTOM_CA_SIGNED_CERTIFICATES` instead." ); END OF DEPRECATED CASES case TRUST_CUSTOM_CA_SIGNED_CERTIFICATES: return SecurityPlan.forCustomCASignedCertificates( config.trustStrategy().certFile() ); case TRUST_SYSTEM_CA_SIGNED_CERTIFICATES: return SecurityPlan.forSystemCASignedCertificates(); case TRUST_ALL_CERTIFICATES: return SecurityPlan.forAllCertificates(); default: throw new ClientException( "Unknown TLS authentication strategy: " + config.trustStrategy().strategy().name() ); } } else { return insecure(); } }
Source:
public void onPlaybackPaused() { setScreenOnWhilePlaying(false); try{ if(player!=null){ double current_time = player.getCurrentPosition()/AppConstants.MILLISECONDS_PER_SECOND ; environment.getAnalyticsRegistry().trackVideoPause(videoEntry.videoId, current_time, videoEntry.eid, videoEntry.lmsUrl, ""); } }catch(Exception e){ logger.error(e); } hideVideoSpeedPopup(); hideCCPopUp(); hideSettingsPopUp(); }

Target:
public void onPlaybackPaused() { setScreenOnWhilePlaying(false); try{ if(player!=null){ double current_time = player.getCurrentPosition()/AppConstants.MILLISECONDS_PER_SECOND ; environment.getAnalyticsRegistry().trackVideoPause(videoEntry.videoId, current_time, videoEntry.eid, videoEntry.lmsUrl, null); } }catch(Exception e){ logger.error(e); } hideVideoSpeedPopup(); hideCCPopUp(); hideSettingsPopUp(); }
Source:
public CopyNumberTriStateHiddenMarkovModel(final double eventRate, final double meanNumberOfTargetsPerEvent, final double deletionMean, final double duplicationMean, final double meanEventTargetDistance) { checkParameterRange(VALID_EVENT_RATE_RANGE, eventRate, "event rate"); checkParameterRange(VALID_MEAN_NUMBER_OF_TARGETS_PER_EVENT_RANGE, meanNumberOfTargetsPerEvent, "mean number of targets per event"); checkParameterRange(VALID_DELETION_CENTER_RANGE, deletionMean, "deletion mean depth coverage shift"); checkParameterRange(VALID_DUPLICATION_CENTER_RANGE, duplicationMean, "duplication mean depth coverage shift"); checkParameterRange(VALID_MEAN_INTRA_EVENT_TARGET_DISTANCE_RANGE, meanEventTargetDistance, "mean intra-event target distance"); P = eventRate; logP = Math.log(eventRate); log1Minus2P = Math.log1p(-2 * eventRate); T = meanNumberOfTargetsPerEvent; logQ = -Math.log(meanNumberOfTargetsPerEvent); log1MinusQ = Math.log1p(-Math.exp(logQ)); D = meanEventTargetDistance; invD = 1.0 / D; deletionDistribution = new NormalDistribution(deletionMean, 1); duplicationDistribution = new NormalDistribution(duplicationMean, 1); }

Target:
public CopyNumberTriStateHiddenMarkovModel(final double eventRate, final double meanNumberOfTargetsPerEvent, final double deletionMean, final double duplicationMean, final double meanEventTargetDistance) { ParamUtils.inRange(VALID_EVENT_RATE_RANGE, eventRate, "event rate"); ParamUtils.inRange(VALID_MEAN_NUMBER_OF_TARGETS_PER_EVENT_RANGE, meanNumberOfTargetsPerEvent, "mean number of targets per event"); ParamUtils.inRange(VALID_DELETION_CENTER_RANGE, deletionMean, "deletion mean depth coverage shift"); ParamUtils.inRange(VALID_DUPLICATION_CENTER_RANGE, duplicationMean, "duplication mean depth coverage shift"); ParamUtils.inRange(VALID_MEAN_INTRA_EVENT_TARGET_DISTANCE_RANGE, meanEventTargetDistance, "mean intra-event target distance"); P = eventRate; logP = Math.log(eventRate); log1Minus2P = Math.log1p(-2 * eventRate); T = meanNumberOfTargetsPerEvent; logQ = -Math.log(meanNumberOfTargetsPerEvent); log1MinusQ = Math.log1p(-Math.exp(logQ)); D = meanEventTargetDistance; invD = 1.0 / D; emissionDistributionByState = new EnumMap<>(CopyNumberTriState.class); emissionDistributionByState.put(CopyNumberTriState.NEUTRAL, new NormalDistribution(0, NEUTRAL_DISTRIBUTION_SD)); emissionDistributionByState.put(CopyNumberTriState.DELETION, new NormalDistribution(deletionMean, DELETION_DISTRIBUTION_SD)); emissionDistributionByState.put(CopyNumberTriState.DUPLICATION, new NormalDistribution(duplicationMean, DUPLICATION_DISTRIBUTION_SD)); }
Source:
public void resume() { checkRealm(); pauseDepth--; if (pauseDepth < 0) { throw new IllegalStateException( "Resume has unessesarily been called too often, so that the pauseDepth is below zero."); } else if (dirty && pauseDepth == 0) { scheduleUpdate(); } }

Target:
public void resume() { checkRealm(); pauseDepth--; if (pauseDepth < 0) { throw new IllegalStateException( "The resume() method was called more often than pause()."); } else if (dirty && pauseDepth == 0) { scheduleUpdate(); } }
Source:
public static void logProjectDetails( String message, String user, String projectName, String projectId, String branch, int revision) { if (!Boolean.getBoolean("emfstore.logDetails")) { return; } logInfo(MessageFormat.format( "Time: {0} | Msg: {1} | User: {2} | Project Name: {3} | Project Id: {4} | Branch: {5} | Revision: {6}", dateFormat.format(new Date()), message, user != null ? user : "not available", projectName != null ? projectName : "not available", projectId != null ? projectId : "not available", branch != null ? branch : "not available", revision != -1 ? revision : "not available")); }

Target:
public static void logProjectDetails( String message, String user, String projectName, String projectId, String branch, int revision) { if (!Boolean.getBoolean("emfstore.logDetails")) { return; } logInfo(MessageFormat.format( "Time: {0} | Msg: {1} | User: {2} | Project Name: {3} | Project Id: {4} | Branch: {5} | Revision: {6}", dateFormat.format(new Date()), message != null ? message : "", user != null ? user : "not available", projectName != null ? projectName : "not available", projectId != null ? projectId : "not available", branch != null ? branch : "not available", revision != -1 ? revision : "not available")); }
Source:
private int labelIndex(JsonReader reader) throws IOException { reader.beginObject(); while (reader.hasNext()) { if (reader.selectName(labelKeyOptions) == -1) { reader.skipName(); reader.skipValue(); continue; } int labelIndex = reader.selectString(labelOptions); if (labelIndex == -1 && defaultValue == null) { throw new JsonDataException("Expected one of " + labels + " for key '" + labelKey + "' but found '" + reader.nextString() + "'. Register a subtype for this label."); } reader.close(); return labelIndex; } return -1; }

Target:
private int labelIndex(JsonReader reader) throws IOException { reader.beginObject(); while (reader.hasNext()) { if (reader.selectName(labelKeyOptions) == -1) { reader.skipName(); reader.skipValue(); continue; } int labelIndex = reader.selectString(labelOptions); if (labelIndex == -1 && !defaultValueSet) { throw new JsonDataException("Expected one of " + labels + " for key '" + labelKey + "' but found '" + reader.nextString() + "'. Register a subtype for this label."); } reader.close(); return labelIndex; } throw new JsonDataException("Missing label for " + labelKey); }
Source:
@Override public void onAttach(Context context) { super.onAttach(context); AndroidSupportInjection.inject(this); }

Target:
@Override public void onAttach(Context context) { AndroidSupportInjection.inject(this); super.onAttach(context); }
Source:
public ScheduleInfoResource(String scheduleName, String taskDefinitionName, Map<String, String> scheduleProperties) { Assert.hasText(scheduleName, "scheduleName must not be null nor empty"); Assert.hasText(taskDefinitionName, "taskDefinitionName must not be null nor empty"); Assert.notNull(scheduleProperties, "schedulerProperties must not be null."); this.scheduleName = scheduleName; this.scheduleProperties = new HashMap<>(); this.scheduleProperties.putAll(scheduleProperties); }

Target:
public ScheduleInfoResource(String scheduleName, String taskDefinitionName, Map<String, String> scheduleProperties) { Assert.hasText(scheduleName, "scheduleName must not be null or empty"); Assert.hasText(taskDefinitionName, "taskDefinitionName must not be null or empty"); Assert.notNull(scheduleProperties, "schedulerProperties must not be null."); this.scheduleName = scheduleName; this.scheduleProperties.putAll(scheduleProperties); }
Source:
protected boolean canCheckThisAnnotation(AnnotationMirror annotation) { return annotationClasses.contains( annotation.getAnnotationType().asElement().toString() ); }

Target:
private boolean canCheckThisAnnotation(AnnotationMirror annotation) { return annotationClasses.contains( annotation.getAnnotationType().asElement().toString() ); }
Source:
public Exercise call() throws Exception { logger.info("Checking adaptive exercises availability"); Exercise exercise = tmcServerCommunicationTaskFactory.getAdaptiveExercise().call(); if (exercise == null) { return null; } exercise.setName("AdaLovelace"); exercise.setCourseName("None"); byte[] zipb = tmcServerCommunicationTaskFactory.getDownloadingExerciseZipTask(exercise).call(); Progress progress = new Progress(3); extractProject(zipb, exercise, progress); return exercise; }

Target:
public Exercise call() throws Exception { logger.info("Checking adaptive exercises availability"); Exercise exercise = tmcServerCommunicationTaskFactory.getAdaptiveExercise().call(); if (exercise == null) { return null; } exercise.setName("AdaLovelace"); exercise.setCourseName("None"); byte[] zipb = tmcServerCommunicationTaskFactory.getDownloadingExerciseZipTask(exercise).call(); Progress progress = new Progress(1); extractProject(zipb, exercise, progress); return exercise; }
Source:
static FetchBlobRequest newFetchBlobRequest( String instanceName, List<URL> urls, Map<URI, Map<String, String>> authHeaders, com.google.common.base.Optional<Checksum> checksum, String canonicalId) { FetchBlobRequest.Builder requestBuilder = FetchBlobRequest.newBuilder() .setInstanceName(instanceName); for (URL url : urls) { requestBuilder.addUris(url.toString()); } if (checksum.isPresent()) { requestBuilder.addQualifiers( Qualifier.newBuilder() .setName("checksum.sri") .setValue(checksum.get().toSubresourceIntegrity()).build()); } if (!Strings.isNullOrEmpty(canonicalId)) { requestBuilder.addQualifiers( Qualifier.newBuilder() .setName("bazel.canonical_id") .setValue(canonicalId).build()); } if (!authHeaders.isEmpty()) { requestBuilder.addQualifiers( Qualifier.newBuilder() .setName("bazel.auth_headers") .setValue(authHeadersJson(authHeaders)).build()); } return requestBuilder.build(); }

Target:
static FetchBlobRequest newFetchBlobRequest( String instanceName, List<URL> urls, Map<URI, Map<String, String>> authHeaders, com.google.common.base.Optional<Checksum> checksum, String canonicalId) { FetchBlobRequest.Builder requestBuilder = FetchBlobRequest.newBuilder().setInstanceName(instanceName); for (URL url : urls) { requestBuilder.addUris(url.toString()); } if (checksum.isPresent()) { requestBuilder.addQualifiers( Qualifier.newBuilder() .setName(QUALIFIER_CHECKSUM_SRI) .setValue(checksum.get().toSubresourceIntegrity()) .build()); } if (!Strings.isNullOrEmpty(canonicalId)) { requestBuilder.addQualifiers( Qualifier.newBuilder().setName(QUALIFIER_CANONICAL_ID).setValue(canonicalId).build()); } if (!authHeaders.isEmpty()) { requestBuilder.addQualifiers( Qualifier.newBuilder() .setName(QUALIFIER_AUTH_HEADERS) .setValue(authHeadersJson(authHeaders)) .build()); } return requestBuilder.build(); }