auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void showDialog(Context context) { AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.setTitle(context.getString(R.string.pref_filter_feed_title)); dialog.setPositiveButton(null, null); dialog.setNegativeButton(android.R.string.cancel, (d, listener) -> d.dismiss()); int selectedIndexTemp = 0; int selected = UserPreferences.getFeedFilter(); String[] entryValues = context.getResources().getStringArray(R.array.nav_drawer_feed_filter_values); for (int i = 0; i < entryValues.length; i++) { if (Integer.parseInt(entryValues[i]) == selected) selectedIndexTemp = i; } final int selectedIndex = selectedIndexTemp; dialog.setSingleChoiceItems(context.getResources().getStringArray(R.array.nav_drawer_feed_filter_options), selectedIndex, (d, which) -> { if (selectedIndex != which) { UserPreferences.setFeedFilter(entryValues[which]); EventBus.getDefault().post(new UnreadItemsUpdateEvent()); } d.dismiss(); }); dialog.show(); }

Target:
public static void showDialog(Context context) { AlertDialog.Builder dialog = new AlertDialog.Builder(context); dialog.setTitle(context.getString(R.string.pref_filter_feed_title)); dialog.setNegativeButton(android.R.string.cancel, (d, listener) -> d.dismiss()); int selectedIndexTemp = 0; int selected = UserPreferences.getFeedFilter(); String[] entryValues = context.getResources().getStringArray(R.array.nav_drawer_feed_filter_values); for (int i = 0; i < entryValues.length; i++) { if (Integer.parseInt(entryValues[i]) == selected) { selectedIndexTemp = i; } } final int selectedIndex = selectedIndexTemp; String[] items = context.getResources().getStringArray(R.array.nav_drawer_feed_filter_options); dialog.setSingleChoiceItems(items, selectedIndex, (d, which) -> { if (selectedIndex != which) { UserPreferences.setFeedFilter(entryValues[which]); EventBus.getDefault().post(new UnreadItemsUpdateEvent()); } d.dismiss(); }); dialog.show(); }
Source:
public void testAjaxAndEnclosures() throws Exception { tester.startPage(SimplePage3.class); tester.assertRenderedPage(SimplePage3.class); tester.clickLink("ajaxLink", true); String lastResponse = tester.getLastResponseAsString(); String headerContribution = lastResponse.split("<header-contribution")[1].split("</header-contribution")[0]; Pattern headerStylesheetLinkExtractor = Pattern.compile("<link.*/>"); Matcher headerStyleSheetLinkMatcher = headerStylesheetLinkExtractor.matcher(headerContribution); List<String> headerStylesheetLinks = new ArrayList<>(); while (headerStyleSheetLinkMatcher.find()){ headerStylesheetLinks.add(headerStyleSheetLinkMatcher.group()); } assertTrue(headerStylesheetLinks.contains("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../enclosedInInline.css\" />")); assertTrue(headerStylesheetLinks.contains("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../enclosed.css\" />")); }

Target:
public void testAjaxAndEnclosures() throws Exception { tester.startPage(EnclosureAjaxRenderPage.class); tester.assertRenderedPage(EnclosureAjaxRenderPage.class); tester.clickLink("ajaxLink", true); String lastResponse = tester.getLastResponseAsString(); String headerContribution = lastResponse.split("<header-contribution")[1].split("</header-contribution")[0]; Pattern headerStylesheetLinkExtractor = Pattern.compile("<link.*/>"); Matcher headerStyleSheetLinkMatcher = headerStylesheetLinkExtractor.matcher(headerContribution); List<String> headerStylesheetLinks = new ArrayList<>(); while (headerStyleSheetLinkMatcher.find()){ headerStylesheetLinks.add(headerStyleSheetLinkMatcher.group()); } assertTrue(headerStylesheetLinks.contains("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../enclosedInInline.css\" />")); assertTrue(headerStylesheetLinks.contains("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../enclosed.css\" />")); }
Source:
AuthenticationRequestState getWaitingRequest(final int requestId) throws AuthenticationException { Logger.v(TAG, "Get waiting request: " + requestId); AuthenticationRequestState request; synchronized (mDelegateMap) { request = mDelegateMap.get(requestId); } if (request == null) { Logger.e(TAG, "Request callback is not available for requestid:" + requestId, "", ADALError.CALLBACK_IS_NOT_FOUND); throw new AuthenticationException(ADALError.CALLBACK_IS_NOT_FOUND, "Request callback is not available for requestid:" + requestId); } return request; }

Target:
AuthenticationRequestState getWaitingRequest(final int requestId) throws AuthenticationException { Logger.v(TAG, "Get waiting request: " + requestId); AuthenticationRequestState request; synchronized (mDelegateMap) { request = mDelegateMap.get(requestId); } if (request == null) { Logger.e(TAG, "Request callback is not available for requestId:" + requestId, "", ADALError.CALLBACK_IS_NOT_FOUND); throw new AuthenticationException(ADALError.CALLBACK_IS_NOT_FOUND, "Request callback is not available for requestId:" + requestId); } return request; }
Source:
private static String getCookie(HttpServletRequest request) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (javax.servlet.http.Cookie cookie : cookies) { if (cookie.getName().equals(OAuthConstants.STATUSCOOKIE)) { return cookie.getValue(); } } } return null; }

Target:
private static String getCookie(HttpServletRequest request) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (javax.servlet.http.Cookie cookie : cookies) { if (OAuthConstants.STATUSCOOKIE.equals(cookie.getName())) { return cookie.getValue(); } } } return null; }
Source:
public static SyncState fromJSON(JSONObject sync) throws JSONException { SyncState state = new SyncState(); state.id = sync.getLong(SmartStore.SOUP_ENTRY_ID); state.type = Type.valueOf(sync.getString(SYNC_TYPE)); state.name = JSONObjectHelper.optString(sync, SYNC_NAME); final JSONObject jsonTarget = sync.optJSONObject(SYNC_TARGET); state.target = (state.type == Type.syncDown ? SyncDownTarget.fromJSON(jsonTarget) : SyncUpTarget.fromJSON(jsonTarget)); state.options = SyncOptions.fromJSON(sync.optJSONObject(SYNC_OPTIONS)); state.soupName = sync.getString(SYNC_SOUP_NAME); state.status = Status.valueOf(sync.getString(SYNC_STATUS)); state.progress = sync.getInt(SYNC_PROGRESS); state.totalSize = sync.getInt(SYNC_TOTAL_SIZE); state.maxTimeStamp = sync.optLong(SYNC_MAX_TIME_STAMP, -1); state.startTime = sync.optLong(SYNC_START_TIME, 0); state.endTime = sync.optLong(SYNC_START_TIME, 0); state.errorJSON = sync.getString(SYNC_ERROR); return state; }

Target:
public static SyncState fromJSON(JSONObject sync) throws JSONException { SyncState state = new SyncState(); state.id = sync.getLong(SmartStore.SOUP_ENTRY_ID); state.type = Type.valueOf(sync.getString(SYNC_TYPE)); state.name = JSONObjectHelper.optString(sync, SYNC_NAME); final JSONObject jsonTarget = sync.optJSONObject(SYNC_TARGET); state.target = (state.type == Type.syncDown ? SyncDownTarget.fromJSON(jsonTarget) : SyncUpTarget.fromJSON(jsonTarget)); state.options = SyncOptions.fromJSON(sync.optJSONObject(SYNC_OPTIONS)); state.soupName = sync.getString(SYNC_SOUP_NAME); state.status = Status.valueOf(sync.getString(SYNC_STATUS)); state.progress = sync.getInt(SYNC_PROGRESS); state.totalSize = sync.getInt(SYNC_TOTAL_SIZE); state.maxTimeStamp = sync.optLong(SYNC_MAX_TIME_STAMP, -1); state.startTime = sync.optLong(SYNC_START_TIME, 0); state.endTime = sync.optLong(SYNC_START_TIME, 0); state.errorJSON = JSONObjectHelper.optString(sync, SYNC_ERROR, ""); return state; }
Source:
public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { boolean ignoreOwnership = ignoreOwnership(command); AggregateCompletionStage<Void> aggregateCompletionStage = null; for (Object key : command.getKeys()) { CompletionStage<Void> stage = entryFactory.wrapEntryForReading(ctx, key, keyPartitioner.getSegment(key), ignoreOwnership || canReadKey(key)); aggregateCompletionStage = accumulateStage(stage, aggregateCompletionStage); } InvocationFinallyFunction<GetAllCommand> handleFunction = (rCtx, getAllCommand, rv, t) -> { if (useRepeatableRead) { for (Object key : getAllCommand.getKeys()) { CacheEntry cacheEntry = rCtx.lookupEntry(key); if (cacheEntry == null) { if (trace) log.tracef(t, "Missing entry for " + key); } else { cacheEntry.setSkipLookup(true); } } } AggregateCompletionStage<Void> stage = CompletionStages.aggregateCompletionStage(); if (t == null && rv instanceof Map) { boolean notify = !command.hasAnyFlag(FlagBitSets.SKIP_LISTENER_NOTIFICATION) && notifier.hasListener(CacheEntryVisited.class); log.tracef("Notifying getAll? %s; result %s", notify, rv); if (notify) { Map<Object, Object> map = (Map<Object, Object>) rv; for (Map.Entry<Object, Object> entry : map.entrySet()) { Object value = entry.getValue(); if (value != null) { Object finalValue = command.isReturnEntries() ? ((CacheEntry) value).getValue() : entry.getValue(); CompletionStage<Void> innerStage = notifier.notifyCacheEntryVisited(entry.getKey(), finalValue, true, rCtx, getAllCommand); stage.dependsOn(innerStage.thenCompose(ig -> notifier.notifyCacheEntryVisited(entry.getKey(), finalValue, false, rCtx, getAllCommand))); } } } } return delayedValue(stage.freeze(), rv, t); }; if (aggregateCompletionStage != null) { return asyncValue(aggregateCompletionStage.freeze()).andHandle(ctx, command, handleFunction); } return invokeNextAndHandle(ctx, command, handleFunction); }

Target:
public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { boolean ignoreOwnership = ignoreOwnership(command); AggregateCompletionStage<Void> aggregateCompletionStage = null; for (Object key : command.getKeys()) { CompletionStage<Void> stage = entryFactory.wrapEntryForReading(ctx, key, keyPartitioner.getSegment(key), ignoreOwnership || canReadKey(key)); aggregateCompletionStage = accumulateStage(stage, aggregateCompletionStage); } return makeStage(asyncInvokeNext(ctx, command, aggregatedStageOrCompleted(aggregateCompletionStage))) .andHandle(ctx, command, getAllHandleFunction); }
Source:
private Object primaryReturnHandler(InvocationContext ctx, VisitableCommand visitableCommand, Object localResult) { DataWriteCommand command = (DataWriteCommand) visitableCommand; if (!command.isSuccessful()) { if (trace) log.tracef("Skipping the replication of the conditional command as it did not succeed on primary owner (%s).", command); return localResult; } DistributionInfo distributionInfo = checkTopologyId(command).getDistribution(command.getKey()); Collection<Address> owners = distributionInfo.writeOwners(); if (owners.size() == 1) { return localResult; } ValueMatcher originalMatcher = command.getValueMatcher(); command.setValueMatcher(ValueMatcher.MATCH_ALWAYS); Collection<Address> recipients = isReplicated ? null : owners; RpcOptions rpcOptions = determineRpcOptionsForBackupReplication(rpcManager, isSynchronous(command), recipients); CompletableFuture<Map<Address, Response>> remoteInvocation = rpcManager.invokeRemotelyAsync(recipients, command, rpcOptions); return asyncValue(remoteInvocation.handle((responses, t) -> { command.setValueMatcher(originalMatcher.matcherForRetry()); CompletableFutures.rethrowException(t instanceof RemoteException ? t.getCause() : t); return localResult; })); }

Target:
private Object primaryReturnHandler(InvocationContext ctx, VisitableCommand visitableCommand, Object localResult) { DataWriteCommand command = (DataWriteCommand) visitableCommand; if (!command.isSuccessful()) { if (trace) log.tracef("Skipping the replication of the conditional command as it did not succeed on primary owner (%s).", command); return localResult; } LocalizedCacheTopology cacheTopology = checkTopologyId(command); DistributionInfo distributionInfo = cacheTopology.getDistribution(command.getKey()); Collection<Address> owners = distributionInfo.writeOwners(); if (owners.size() == 1) { return localResult; } Collection<Address> recipients = isReplicated ? null : owners; ValueMatcher originalMatcher = command.getValueMatcher(); command.setValueMatcher(ValueMatcher.MATCH_ALWAYS); RpcOptions rpcOptions = determineRpcOptionsForBackupReplication(rpcManager, isSynchronous(command), recipients); CompletableFuture<Map<Address, Response>> remoteInvocation = rpcManager.invokeRemotelyAsync(recipients, command, rpcOptions); return asyncValue(remoteInvocation.handle((responses, t) -> { command.setValueMatcher(originalMatcher.matcherForRetry()); CompletableFutures.rethrowException(t instanceof RemoteException ? t.getCause() : t); return localResult; })); }
Source:
public static KeyPair genKeyPair(KeyPairType type) throws UnsupportedTypeException{ if(type.equals(KeyPairType.DSA)){ throw new UnsupportedTypeException(type); } try { KeyPairGenerator kg = KeyPairGenerator.getInstance(type.alg); kg.initialize(type.spec); return kg.generateKeyPair(); } catch (GeneralSecurityException e) { Logger.error(KeyGenUtils.class, "Internal error; please report:", e); } return null; }

Target:
public static KeyPair genKeyPair(KeyPairType type) { if(type.equals(KeyPairType.DSA)){ throw new UnsupportedTypeException(type); } try { KeyPairGenerator kg = KeyPairGenerator.getInstance(type.alg); kg.initialize(type.spec); return kg.generateKeyPair(); } catch (GeneralSecurityException e) { Logger.error(KeyGenUtils.class, "Internal error; please report:", e); } return null; }
Source:
public boolean isDirectory() { try { if (directoryFlagSupplier == null) { return childProvider != null; } return directoryFlagSupplier.test(this); } catch (Exception e) { throw handleErrorInCallback(e, "directoryFlagSupplier"); } }

Target:
public boolean isDirectory() { try { if (directoryFlagSupplier != null) { return directoryFlagSupplier.test(this); } return childProvider != null; } catch (Exception e) { throw handleErrorInCallback(e, "directoryFlagSupplier"); } }
Source:
public CompletableFuture<Object> invokeAsync(InvocationContext ctx, VisitableCommand command) { try { command.init(componentRegistry); Object result = firstInterceptor.visitCommand(ctx, command); if (result instanceof InvocationStage) { return ((InvocationStage) result).toCompletableFuture(); } else { if (result == null) { return CompletableFutures.completedNull(); } return CompletableFuture.completedFuture(result); } } catch (Throwable t) { return CompletableFutures.completedExceptionFuture(t); } }

Target:
public CompletableFuture<Object> invokeAsync(InvocationContext ctx, VisitableCommand command) { try { Object result = firstInterceptor.visitCommand(ctx, command); if (result instanceof InvocationStage) { return ((InvocationStage) result).toCompletableFuture(); } else { if (result == null) { return CompletableFutures.completedNull(); } return CompletableFuture.completedFuture(result); } } catch (Throwable t) { return CompletableFutures.completedExceptionFuture(t); } }
Source:
public void testNullValue() { Properties empty = new Properties(); assertNull(PGProperty.LOG_LEVEL.getSetString(empty)); assertNull(PGProperty.LOG_LEVEL.getSetString(empty)); Properties withLogging = new Properties(); withLogging.setProperty(PGProperty.LOG_LEVEL.getName(), "2"); assertNotNull(PGProperty.LOG_LEVEL.getSetString(withLogging)); }

Target:
public void testNullValue() { Properties empty = new Properties(); assertNull(PGProperty.LOG_LEVEL.getSetString(empty)); Properties withLogging = new Properties(); withLogging.setProperty(PGProperty.LOG_LEVEL.getName(), "2"); assertNotNull(PGProperty.LOG_LEVEL.getSetString(withLogging)); }
Source:
public BundleFilterTimeRange(@JsonProperty(value = "time", required = true) AutoField time, @JsonProperty("before") String before, @JsonProperty("after") String after, @JsonProperty("defaultExit") boolean defaultExit, @JsonProperty("timeFormat") String timeFormat, @JsonProperty("timeZone") String timeZone) { this.time = time; this.before = before; this.after = after; this.defaultExit = defaultExit; this.timeFormat = timeFormat; this.timeZone = timeZone; if (before != null) { tbefore = convertDate(before); } else { tbefore = 0; } if (after != null) { tafter = convertDate(after); } else { tafter = 0; } if ( timeZone != null ) { this.format = DateTimeFormat.forPattern(timeFormat).withZone(DateTimeZone.forID(timeZone)); } else if( timeZone == null && timeFormat != null ) { this.format = DateTimeFormat.forPattern(timeFormat); } else { this.format = null; } }

Target:
public BundleFilterTimeRange(@JsonProperty(value = "time", required = true) AutoField time, @JsonProperty("before") String before, @JsonProperty("after") String after, @JsonProperty("defaultExit") boolean defaultExit, @JsonProperty("timeFormat") String timeFormat, @JsonProperty("timeZone") String timeZone) { this.time = time; this.before = before; this.after = after; this.defaultExit = defaultExit; this.timeFormat = timeFormat; this.timeZone = timeZone; if (before != null) { tbefore = convertDate(before); } else { tbefore = 0; } if (after != null) { tafter = convertDate(after); } else { tafter = 0; } if( timeFormat == null ) { this.format = null; } else if ( timeZone == null ) { this.format = DateTimeFormat.forPattern(timeFormat); } else { this.format = DateTimeFormat.forPattern(timeFormat).withZone(DateTimeZone.forID(timeZone)); } }
Source:
private void validatePublicModifierOnJavaMethod(final JaxrsResourceMethod resourceMethod) throws CoreException { final IMethod javaMethod = resourceMethod.getJavaElement(); final IType parentClass = resourceMethod.getParentResource().getJavaElement(); if (!parentClass.isInterface() && !Flags.isPublic(javaMethod.getFlags())) { final ISourceRange nameRange = javaMethod.getNameRange(); markerManager.addMarker(resourceMethod, nameRange, JaxrsValidationMessages.RESOURCE_METHOD_NO_PUBLIC_MODIFIER, new String[]{resourceMethod.getName()}, JaxrsPreferences.RESOURCE_METHOD_NO_PUBLIC_MODIFIER); } }

Target:
private void validatePublicModifierOnJavaMethod(final JaxrsResourceMethod resourceMethod) throws CoreException { final IMethod javaMethod = resourceMethod.getJavaElement(); final JaxrsResource parentResource = resourceMethod.getParentResource(); if(javaMethod == null || parentResource == null || parentResource.getJavaElement() == null) { return; } if (!parentResource.getJavaElement().isInterface() && !Flags.isPublic(javaMethod.getFlags())) { final ISourceRange nameRange = javaMethod.getNameRange(); markerManager.addMarker(resourceMethod, nameRange, JaxrsValidationMessages.RESOURCE_METHOD_NO_PUBLIC_MODIFIER, new String[]{resourceMethod.getName()}, JaxrsPreferences.RESOURCE_METHOD_NO_PUBLIC_MODIFIER); } }
Source:
protected static Stream<HttpClient> getHttpClients() { if (testMode == TestMode.PLAYBACK) { return Stream.of(new HttpClient[]{null}); } return HttpClientProviders.getAllHttpClients().stream().filter(TestBase::shouldClientBeTested); }

Target:
public static Stream<HttpClient> getHttpClients() { if (testMode == TestMode.PLAYBACK) { return Stream.of(new HttpClient[]{null}); } return HttpClientProviders.getAllHttpClients().stream().filter(TestBase::shouldClientBeTested); }
Source:
private List<String> getArchivedResourcesId(List<String> resourceIds) { List<String> archivedResources = null; if (null != resourceIds) { Iterator<String> it = resourceIds.iterator(); String id = null; while (it.hasNext()) { ResourceInterface resourceInterface = null; id = (String) it.next(); try { resourceInterface = this.getResourceManager().loadResource(id); if (null != resourceInterface) { if ( null == archivedResources) { archivedResources = new ArrayList<>(); } archivedResources.add(id); } } catch (Throwable t) { logger.error("Errore in verifica risorsa " + id, t); throw new RuntimeException("Errore in verifica risorsa in archivio, id " + id, t); } } } return archivedResources; }

Target:
private List<String> getArchivedResourcesId(List<String> resourceIds) { List<String> archivedResources = null; if (null != resourceIds) { Iterator<String> it = resourceIds.iterator(); String id = null; while (it.hasNext()) { ResourceInterface resourceInterface = null; id = (String) it.next(); try { resourceInterface = this.getResourceManager().loadResource(id); if (null != resourceInterface) { if ( null == archivedResources) { archivedResources = new ArrayList<>(); } archivedResources.add(id); } } catch (Throwable t) { logger.error("Error checking resource " + id, t); throw new RuntimeException("Error checking resource " + id, t); } } } return archivedResources; }
Source:
public void setNeedsReschedule(boolean needsReschedule) { mWorkDatabase.beginTransaction(); try { Preference preference = new Preference(KEY_RESCHEDULE_NEEDED, needsReschedule); mWorkDatabase.preferenceDao().insertPreference(preference); mWorkDatabase.setTransactionSuccessful(); } finally { mWorkDatabase.endTransaction(); } }

Target:
public void setNeedsReschedule(boolean needsReschedule) { Preference preference = new Preference(KEY_RESCHEDULE_NEEDED, needsReschedule); mWorkDatabase.preferenceDao().insertPreference(preference); mWorkDatabase.setTransactionSuccessful(); }
Source:
public void testGetRangeMultipart() throws InterruptedException, IOException { String container = getContainerName(); try { String name = "apples"; long length = getMinimumMultipartBlobSize(); ByteSource byteSource = TestUtils.randomByteSource().slice(0, length); Blob blob = view.getBlobStore().blobBuilder(name) .payload(byteSource) .contentLength(length) .build(); view.getBlobStore().putBlob(container, blob, new PutOptions().multipart(true)); blob = view.getBlobStore().getBlob(container, name, range(0, 5)); validateMetadata(blob.getMetadata(), container, name); } finally { returnContainer(container); } }

Target:
public void testGetRangeMultipart() throws InterruptedException, IOException { String container = getContainerName(); InputStream expect = null; InputStream actual = null; try { String name = "apples"; long length = getMinimumMultipartBlobSize(); ByteSource byteSource = TestUtils.randomByteSource().slice(0, length); Blob blob = view.getBlobStore().blobBuilder(name) .payload(byteSource) .contentLength(length) .build(); view.getBlobStore().putBlob(container, blob, new PutOptions().multipart(true)); blob = view.getBlobStore().getBlob(container, name, range(0, 5)); validateMetadata(blob.getMetadata(), container, name); expect = byteSource.slice(0, 6).openStream(); actual = blob.getPayload().openStream(); assertThat(actual).hasContentEqualTo(expect); } finally { Closeables2.closeQuietly(expect); Closeables2.closeQuietly(actual); returnContainer(container); } }
Source:
public static <T extends Descriptor> List<T> applyType(Class<?> contextClass, Iterable<T> source) { ExtensionList<DescriptorVisibilityFilter> filters = all(); List<T> r = new ArrayList<T>(); OUTER: for (T d : source) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Determining visibility of " + d + " in contexts of type " + contextClass); } for (DescriptorVisibilityFilter f : filters) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Querying " + f + " for visibility of " + d + " in type " + contextClass); } if (contextClass != null && !f.filterType(contextClass, d)) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.config("Filter " + f + " hides " + d + " in contexts of type " + contextClass); } continue OUTER; } } r.add(d); } return r; }

Target:
public static <T extends Descriptor> List<T> applyType(Class<?> contextClass, Iterable<T> source) { ExtensionList<DescriptorVisibilityFilter> filters = all(); List<T> r = new ArrayList<T>(); OUTER: for (T d : source) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Determining visibility of " + d + " in contexts of type " + contextClass); } for (DescriptorVisibilityFilter f : filters) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Querying " + f + " for visibility of " + d + " in type " + contextClass); } try { if (contextClass != null && !f.filterType(contextClass, d)) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.config("Filter " + f + " hides " + d + " in contexts of type " + contextClass); } continue OUTER; } } catch (Error e) { LOGGER.log(Level.WARNING, "Encountered error while processing filter " + f + " for contexts of type " + contextClass, e); throw e; } catch (Throwable e) { LOGGER.log(logLevelFor(f), "Uncaught exception from filter " + f + " for context of type " + contextClass, e); continue OUTER; } } r.add(d); } return r; }
Source:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (UserPreferences.PREF_CAST_ENABLED.equals(key)) { isCastEnabled = UserPreferences.isCastEnabled(); Log.d(TAG, "onSharedPreferenceChanged(), isCastEnabled set to " + isCastEnabled); mMediaRouteActionProvider.setEnabled(isCastEnabled); if (isCastEnabled) { if (castUICounter==1) { mCastManager.incrementUiCounter(); castUICounter++; } } else { if (castUICounter > 1) { mCastManager.decrementUiCounter(); castUICounter--; } if (!PlaybackService.isRunning) { CastManager.getInstance().disconnect(); } } } }

Target:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { if (UserPreferences.PREF_CAST_ENABLED.equals(key)) { boolean newValue = UserPreferences.isCastEnabled(); Log.d(TAG, "onSharedPreferenceChanged(), isCastEnabled set to " + newValue); castButtonVisibilityManager.setPrefEnabled(newValue); if (!newValue && !PlaybackService.isRunning) { CastManager.getInstance().disconnect(); } } }
Source:
public CompletableFuture<TermIndex> notifyInstallSnapshotFromLeader( RaftProtos.RoleInfoProto roleInfoProto, TermIndex firstTermIndexInLog) { if (roleInfoProto.getRole() != RaftProtos.RaftPeerRole.FOLLOWER) { return RaftJournalUtils.completeExceptionally( new IllegalStateException("Received snapshot as a non-follower")); } return mSnapshotManager.installSnapshotFromLeader(); }

Target:
public CompletableFuture<TermIndex> notifyInstallSnapshotFromLeader( RaftProtos.RoleInfoProto roleInfoProto, TermIndex firstTermIndexInLog) { if (roleInfoProto.getRole() != RaftProtos.RaftPeerRole.FOLLOWER) { return RaftJournalUtils.completeExceptionally( new IllegalStateException(String.format( "Server should be a follower when installing a snapshot from leader. Actual: %s", roleInfoProto.getRole()))); } return mSnapshotManager.installSnapshotFromLeader(); }
Source:
private boolean hasSameSeparateDerivedEncodings() { return (separateDerivedEncodingsButton == null) || (separateDerivedEncodingsButton.getSelection() == getStoredSeparateDerivedEncodingsValue()); }

Target:
private boolean hasSameSeparateDerivedEncodings() { return separateDerivedEncodingsButton == null || separateDerivedEncodingsButton.getSelection() == getStoredSeparateDerivedEncodingsValue(); }
Source:
public boolean hasNext() { try { if (currentResponse == null) { if (programmeQueries.hasNext()) { currentResponse = client.execute(programmeQueries.next()); return currentResponse.hasNext(); } else { return false; } } else if (currentResponse.hasNext()) { return true; } else { if (programmeQueries.hasNext()) { currentResponse = client.execute(programmeQueries.next()); return currentResponse.hasNext(); } else { return false; } } } catch (GlycerinException e) { throw Throwables.propagate(e); } }

Target:
public boolean hasNext() { if (currentResponse == null) { return executeRequest(); } else { return currentResponse.hasNext(); } }
Source:
protected RequestScope(String path, JsonApiDocument jsonApiDocument, RequestScope outerRequestScope) { this.jsonApiDocument = jsonApiDocument; this.baseUrlEndPoint = null; this.path = path; this.transaction = outerRequestScope.transaction; this.user = outerRequestScope.user; this.dictionary = outerRequestScope.dictionary; this.mapper = outerRequestScope.mapper; this.auditLogger = outerRequestScope.auditLogger; this.queryParams = Optional.empty(); this.sparseFields = Collections.emptyMap(); this.sorting = Sorting.getDefaultEmptyInstance(); this.pagination = Pagination.getDefaultPagination(outerRequestScope.getElideSettings()); this.objectEntityCache = outerRequestScope.objectEntityCache; this.newPersistentResources = outerRequestScope.newPersistentResources; this.permissionExecutor = outerRequestScope.getPermissionExecutor(); this.dirtyResources = outerRequestScope.dirtyResources; this.deletedResources = outerRequestScope.deletedResources; this.filterDialect = outerRequestScope.filterDialect; this.expressionsByType = outerRequestScope.expressionsByType; this.elideSettings = outerRequestScope.elideSettings; this.useFilterExpressions = outerRequestScope.useFilterExpressions; this.updateStatusCode = outerRequestScope.updateStatusCode; this.lifecycleEvents = outerRequestScope.lifecycleEvents; this.distinctLifecycleEvents = outerRequestScope.distinctLifecycleEvents; this.queuedLifecycleEvents = outerRequestScope.queuedLifecycleEvents; }

Target:
protected RequestScope(String path, JsonApiDocument jsonApiDocument, RequestScope outerRequestScope) { this.jsonApiDocument = jsonApiDocument; this.baseUrlEndPoint = outerRequestScope.baseUrlEndPoint; this.path = path; this.transaction = outerRequestScope.transaction; this.user = outerRequestScope.user; this.dictionary = outerRequestScope.dictionary; this.mapper = outerRequestScope.mapper; this.auditLogger = outerRequestScope.auditLogger; this.queryParams = Optional.empty(); this.sparseFields = Collections.emptyMap(); this.sorting = Sorting.getDefaultEmptyInstance(); this.pagination = Pagination.getDefaultPagination(outerRequestScope.getElideSettings()); this.objectEntityCache = outerRequestScope.objectEntityCache; this.newPersistentResources = outerRequestScope.newPersistentResources; this.permissionExecutor = outerRequestScope.getPermissionExecutor(); this.dirtyResources = outerRequestScope.dirtyResources; this.deletedResources = outerRequestScope.deletedResources; this.filterDialect = outerRequestScope.filterDialect; this.expressionsByType = outerRequestScope.expressionsByType; this.elideSettings = outerRequestScope.elideSettings; this.useFilterExpressions = outerRequestScope.useFilterExpressions; this.updateStatusCode = outerRequestScope.updateStatusCode; this.lifecycleEvents = outerRequestScope.lifecycleEvents; this.distinctLifecycleEvents = outerRequestScope.distinctLifecycleEvents; this.queuedLifecycleEvents = outerRequestScope.queuedLifecycleEvents; }
Source:
public double getHomLogLikelihood(final Map<Nucleotide, List<BaseQuality>> baseQualities, final Nucleotide refNucleotide, final Nucleotide altNucleotide, final double homRefPrior) { return GATKProtectedMathUtils.logSumExp( FastMath.log(homRefPrior) + getSingletonLogLikelihood(baseQualities, refNucleotide), FastMath.log(1 - homRefPrior) + getSingletonLogLikelihood(baseQualities, altNucleotide)); }

Target:
double getHomLogLikelihood(final Map<Nucleotide, List<BaseQuality>> baseQualities, final Nucleotide refNucleotide, final Nucleotide altNucleotide, final double homRefPrior) { return GATKProtectedMathUtils.logSumExp( FastMath.log(homRefPrior) + getSingletonLogLikelihood(baseQualities, refNucleotide), FastMath.log(1 - homRefPrior) + getSingletonLogLikelihood(baseQualities, altNucleotide)); }
Source:
public long getRunningTasksCount() { return executeReadOnlyTransaction(session -> { Query query = session.getNamedQuery("getRunningTasksCount") .setParameterList("jobStatus", NOT_FINISHED_JOB_STATUSES) .setParameterList("taskStatus", Arrays.asList(TaskStatus.RUNNING)); return (Long) query.uniqueResult(); }); }

Target:
public long getRunningTasksCount() { return executeReadOnlyTransaction(session -> { Query query = session.getNamedQuery("getRunningTasksCount") .setParameterList("jobStatus", NOT_FINISHED_JOB_STATUSES) .setParameterList("taskStatus", Collections.singletonList(TaskStatus.RUNNING)); return (Long) query.uniqueResult(); }); }
Source:
private void deleteTempPacksIdx() { Path packDir = repo.getObjectDatabase().getPackDirectory().toPath(); try { Files.newDirectoryStream(packDir, "gc_*_tmp") .forEach(t -> { try { long lastModified = Files.getLastModifiedTime(t) .toMillis(); long threshold = lastModified + 24 * 60 * 60 * 1000; if (threshold <= Instant.now().toEpochMilli()) { Files.deleteIfExists(t); } } catch (IOException e) { LOG.error(e.getMessage(), e); } }); } catch (IOException e) { LOG.error(e.getMessage(), e); } }

Target:
private void deleteTempPacksIdx() { Path packDir = repo.getObjectDatabase().getPackDirectory().toPath(); long threshold = Instant.now().toEpochMilli() - 24 * 60 * 60 * 1000; try { Files.newDirectoryStream(packDir, "gc_*_tmp") .forEach(t -> { try { long lastModified = Files.getLastModifiedTime(t) .toMillis(); if (lastModified < threshold) { Files.deleteIfExists(t); } } catch (IOException e) { LOG.error(e.getMessage(), e); } }); } catch (IOException e) { LOG.error(e.getMessage(), e); } }
Source:
public static InputFile inputFile(String moduleKey, File file) { try { return new TestInputFileBuilder(moduleKey, file.getPath()) .setContents(new String(Files.readAllBytes(file.toPath()), UTF_8)) .setCharset(UTF_8) .setLanguage("java") .build(); } catch (Exception e) { throw new IllegalStateException(String.format("Unable to lead file '%s", file.getAbsolutePath())); } }

Target:
public static InputFile inputFile(String moduleKey, File file) { try { return new TestInputFileBuilder(moduleKey, file.getPath()) .setContents(new String(Files.readAllBytes(file.toPath()), UTF_8)) .setCharset(UTF_8) .setLanguage("java") .build(); } catch (Exception e) { throw new IllegalStateException(String.format("Unable to read file '%s", file.getAbsolutePath())); } }
Source:
private void setupContextListener() { IDebugContextManager contextManager = DebugContextManager.getDefault(); IDebugContextService contextService = contextManager .getContextService(getSite().getWorkbenchWindow()); fDebugContextListener = new IDebugContextListener() { @Override public void debugContextChanged(DebugContextEvent event) { if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) { ISelection s = event.getContext(); setDebugContext(s); } } }; contextService.addDebugContextListener(fDebugContextListener); setDebugContext(contextService.getActiveContext()); }

Target:
private void setupContextListener() { IDebugContextManager contextManager = DebugUITools.getDebugContextManager(); IDebugContextService contextService = contextManager .getContextService(getSite().getWorkbenchWindow()); fDebugContextListener = new IDebugContextListener() { @Override public void debugContextChanged(DebugContextEvent event) { if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) { ISelection s = event.getContext(); setDebugContext(s); } } }; contextService.addDebugContextListener(fDebugContextListener); setDebugContext(contextService.getActiveContext()); }
Source:
public void deleteNoAccess() throws Exception { ObjectMapper mapper = new ObjectMapper(); context.turnOffAuthorisationSystem(); BitstreamFormat bitstreamFormat = BitstreamFormatBuilder.createBitstreamFormat(context) .withMimeType("application/octet-stream") .withDescription("Description - updateAdminAccess") .build(); context.restoreAuthSystemState(); getClient(null).perform(delete("/api/core/bitstreamformats/" + bitstreamFormat.getID())) .andExpect(status().isUnauthorized()); }

Target:
public void deleteNoAccess() throws Exception { ObjectMapper mapper = new ObjectMapper(); context.turnOffAuthorisationSystem(); BitstreamFormat bitstreamFormat = BitstreamFormatBuilder.createBitstreamFormat(context) .withMimeType("application/octet-stream") .withDescription("Description - updateAdminAccess") .build(); context.restoreAuthSystemState(); getClient(null).perform(delete("/api/core/bitstreamformats/" + bitstreamFormat.getID())) .andExpect(status().isUnauthorized()); getClient().perform(get("/api/core/bitstreamformats/" + bitstreamFormat.getID())) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$", Matchers.is( BitstreamFormatMatcher .matchBitstreamFormat(bitstreamFormat.getID(), bitstreamFormat.getMIMEType(), bitstreamFormat.getDescription(), bitstreamFormat.getShortDescription()) ))); }
Source:
public void deleteRealmIfMigrationNeeded_failsWhenAssetFileProvided() { Context context = InstrumentationRegistry.getInstrumentation().getContext(); Realm.deleteRealm(new RealmConfiguration.Builder(context).build()); RealmConfiguration.Builder builder = new RealmConfiguration.Builder(context); try { builder .assetFile(context, "asset_file.realm") .deleteRealmIfMigrationNeeded(); fail(); } catch (IllegalStateException expected) { assertEquals("Realm cannot clear its schema when previously configured to use an asset file.", expected.getMessage()); } }

Target:
public void deleteRealmIfMigrationNeeded_failsWhenAssetFileProvided() { Context context = InstrumentationRegistry.getInstrumentation().getContext(); RealmConfiguration.Builder builder = new RealmConfiguration.Builder(context); try { builder .assetFile(context, "asset_file.realm") .deleteRealmIfMigrationNeeded(); fail(); } catch (IllegalStateException expected) { assertEquals("Realm cannot clear its schema when previously configured to use an asset file by calling assetFile().", expected.getMessage()); } }
Source:
public void setAuthorizationHelper(IXalanAuthorizationHelper authorizationHelper) { logger.warn("BEACH Test: in setAuthorizationHelper and the upAuth helper is: " + authorizationHelper.getClass()); XalanAuthorizationHelper.authorizationHelper = authorizationHelper; }

Target:
public void setAuthorizationHelper(IXalanAuthorizationHelper authorizationHelper) { XalanAuthorizationHelper.authorizationHelper = authorizationHelper; }
Source:
public TreeDataIndex(double[][] features, double[] labels) { this.features = features; this.labels = labels; int rows = features.length; int cols = features.length == 0 ? 0 : features[0].length; double[][] featuresCopy = new double[rows][cols]; index = new int[rows][cols]; for (int row = 0; row < rows; row++) { for (int col = 0; col < cols; col++) { index[row][col] = row; featuresCopy[row][col] = features[row][col]; } } for (int col = 0; col < cols; col++) sortIndex(featuresCopy, col, 0, rows - 1); }

Target:
public TreeDataIndex(double[][] features, double[] labels) { this.features = features; this.labels = labels; int rows = features.length; int cols = features.length == 0 ? 0 : features[0].length; double[][] featuresCp = new double[rows][cols]; index = new int[rows][cols]; for (int row = 0; row < rows; row++) { Arrays.fill(index[row], row); featuresCp[row] = Arrays.copyOf(features[row], cols); } for (int col = 0; col < cols; col++) sortIndex(featuresCp, col, 0, rows - 1); }
Source:
public ResolvedExpression parseSqlExpression(String sqlExpression, TableSchema inputSchema) { throw new UnsupportedOperationException("Computed column is only supported by Blink planner."); }

Target:
public ResolvedExpression parseSqlExpression(String sqlExpression, TableSchema inputSchema) { throw new UnsupportedOperationException("Computed columns is only supported by the Blink planner."); }
Source:
protected void setStorageService(StorageService storageService) { this.storageService = storageService; setDisabledRuleStorage( storageService.<Boolean>getStorage("automation_rules_disabled", this.getClass().getClassLoader())); }

Target:
protected void setStorageService(StorageService storageService) { this.storageService = storageService; setDisabledRuleStorage( storageService.<Boolean>getStorage(DISABLED_RULE_STORAGE, this.getClass().getClassLoader())); }
Source:
public static List<FilterEntry> parse(String filters) { List<FilterEntry> ret = new LinkedList<>(); Matcher m = parsePattern.matcher(filters); while (m.find()) { log.debug(String.format("parse: handling '%s'", m.group(0))); boolean exclude = "exclude".equals(m.group("exclude")); String event = m.group("event"); String recipient = m.group("recipient"); ret.add(FilterEntry.createEntryFromRecipient(event, exclude, recipient)); } return ret; }

Target:
public static List<FilterEntry> parse(String filters) { List<FilterEntry> ret = new LinkedList<>(); Matcher m = PARSE_PATTERN.matcher(filters); while (m.find()) { log.debug(String.format("parse: handling '%s'", m.group(0))); boolean exclude = "exclude".equals(m.group("exclude")); String event = m.group("event"); String recipient = m.group("recipient"); ret.add(FilterEntry.createEntry(event, exclude, recipient)); } return ret; }
Source:
public static CardType[] mergeTypes(CardType[] a, CardType[] b) { HashSet<CardType> cardTypes = new HashSet<>(); for (CardType t: a) { cardTypes.add(t); } for (CardType t: b) { cardTypes.add(t); } return cardTypes.toArray(new CardType[0]); }

Target:
public static CardType[] mergeTypes(CardType[] a, CardType[] b) { EnumSet<CardType> cardTypes = EnumSet.noneOf(CardType.class); cardTypes.addAll(Arrays.asList(a)); cardTypes.addAll(Arrays.asList(b)); return cardTypes.toArray(new CardType[0]); }
Source:
public void testRecursiveReadSubModeWithResolveExpression() throws Exception { try { ModelNode operation = createOperation(READ_RESOURCE_OPERATION, "profile", "profileA"); System.setProperty("${expr}", "test-resolve-true"); operation.get(RECURSIVE).set(true); operation.get(RESOLVE_EXPRESSIONS).set(true); ModelNode result = executeForResult(operation); result.get("subsystem", "subsystem2", "expression").set(System.getProperty("${expr}")); assertTrue(result.toString(), result.hasDefined("subsystem", "subsystem2")); checkRecursiveSubsystem2(result.get("subsystem", "subsystem2"), "test-resolve-true"); } finally { System.clearProperty("${expr}"); } }

Target:
public void testRecursiveReadSubModeWithResolveExpression() throws Exception { try { ModelNode operation = createOperation(READ_RESOURCE_OPERATION, "profile", "profileA"); System.setProperty("expr", "test-resolve-true"); operation.get(RECURSIVE).set(true); operation.get(RESOLVE_EXPRESSIONS).set(true); ModelNode result = executeForResult(operation); assertTrue(result.toString(), result.hasDefined("subsystem", "subsystem2")); checkRecursiveSubsystem2(result.get("subsystem", "subsystem2"), "test-resolve-true"); } finally { System.clearProperty("expr"); } }
Source:
public StructEncoder int32(String name, int value) { int fieldIndex = fieldSearcher.findFieldIndex(name, Int32Field.class, null); data.add(new Int32DataHolder(value, fieldIndex)); return this; }

Target:
public StructEncoder int32(String name, int value) { Int32Field field = fieldSearcher.findField(name, Int32Field.class, null); data.add(new Int32DataHolder(value, field.index())); return this; }
Source:
private ListenableFuture<?> stashOrSubmitTask(RunnableWithES runnable, final boolean callExecute, final boolean setupTask) { if (m_executor==null) { synchronized (m_executorLock) { if (m_executor==null) { if (m_queuedActions.size() > 50) { StringBuilder builder = new StringBuilder(); builder.append("Export task queue is filled up to: " + m_queuedActions.size() + ", beyond 50. Not queueing anymore events for generation " + m_generation + ". The queue contains the following tasks:\n"); for (RunnableWithES queuedR : m_queuedActions) { builder.append(queuedR.getTaskName() + "\t"); } exportLog.error(builder.toString()); return Futures.immediateFuture(null); } if (setupTask) { m_firstAction = runnable; } else { m_queuedActions.add(runnable); } return Futures.immediateFuture(null); } } } runnable.setExecutorService(m_executor); if (m_executor.isShutdown()) { return Futures.immediateFuture(null); } if (callExecute) { m_executor.execute(runnable); return Futures.immediateFuture(null); } else { return m_executor.submit(runnable); } }

Target:
private ListenableFuture<?> stashOrSubmitTask(RunnableWithES runnable, final boolean callExecute, final boolean setupTask) { if (m_executor==null) { synchronized (m_executorLock) { if (m_executor==null) { if (m_queuedActions.size() > 50) { StringBuilder builder = new StringBuilder(); builder.append("Export task queue is filled up to: " + m_queuedActions.size()); builder.append(". Not queueing anymore events beyond 50 for generation " + m_generation); builder.append(" and table " + m_tableName + ". The queue contains the following tasks:\n"); for (RunnableWithES queuedR : m_queuedActions) { builder.append(queuedR.getTaskName() + "\t"); } exportLog.error(builder.toString()); return Futures.immediateFuture(null); } if (setupTask) { m_firstAction = runnable; } else { m_queuedActions.add(runnable); } return Futures.immediateFuture(null); } } } runnable.setExecutorService(m_executor); if (m_executor.isShutdown()) { return Futures.immediateFuture(null); } if (callExecute) { m_executor.execute(runnable); return Futures.immediateFuture(null); } else { return m_executor.submit(runnable); } }
Source:
public boolean isMatch(String relativeTarget, boolean isDirectory) { String target = relativeTarget; if (!target.startsWith("/")) target = "/" + target; if (matcher == null) { if (target.equals(pattern)) { if (dirOnly && !isDirectory) return false; else return true; } if (target.startsWith(pattern + "/")) return true; if (nameOnly) { int segmentStart = 0; int segmentEnd = target.indexOf('/'); while (true) { if (segmentEnd > segmentStart && target.regionMatches(segmentStart, pattern, 0, segmentEnd - segmentStart) && doesMatchDirectoryExpectations(isDirectory, false)) return true; else if (segmentEnd == -1 && target.regionMatches(segmentStart, pattern, 0, target.length() - segmentStart) && doesMatchDirectoryExpectations(isDirectory, true)) return true; if (segmentEnd == -1 || segmentStart >= target.length()) break; segmentStart = segmentEnd + 1; segmentEnd = target.indexOf('/', segmentStart); } } } else { return matcher.matches(target, isDirectory); } return false; }

Target:
public boolean isMatch(String relativeTarget, boolean isDirectory) { if (relativeTarget == null) return false; if (relativeTarget.length() == 0) return false; boolean match = matcher.matches(relativeTarget, isDirectory); return match; }
Source:
protected void updateData(long start, long end, int nb, @Nullable IProgressMonitor monitor) { double x[] = getXAxis(start, end, nb); setXAxis(x); final double y[] = new double[nb]; final long yLong[] = new long[nb]; Arrays.fill(y, 0.0); for (ITmfTrace trace : TmfTraceManager.getTraceSet(getTrace())) { final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(trace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } statsMod.waitForInitialization(); final ITmfStatistics stats = statsMod.getStatistics(); Objects.requireNonNull(stats); List<Long> values = stats.histogramQuery(start, end, nb); for (int i = 0; i < nb; i++) { yLong[i] += values.get(i); } } for (int i = 0; i < nb; i++) { y[i] += yLong[i]; } setSeries("Number of events", y); updateDisplay(); }

Target:
protected void updateData(long start, long end, int nb, @Nullable IProgressMonitor monitor) { double x[] = getXAxis(start, end, nb); setXAxis(x); final double y[] = new double[nb]; final long yLong[] = new long[nb]; Arrays.fill(y, 0.0); for (ITmfTrace trace : TmfTraceManager.getTraceSet(getTrace())) { final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(trace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } statsMod.waitForInitialization(); final ITmfStatistics stats = Objects.requireNonNull(statsMod.getStatistics()); List<Long> values = stats.histogramQuery(start, end, nb); for (int i = 0; i < nb; i++) { yLong[i] += values.get(i); } } for (int i = 0; i < nb; i++) { y[i] += yLong[i]; } setSeries("Number of events", y); updateDisplay(); }
Source:
private String JSON(Music music) { return new StringBuilder("{\"id\":").append(music.getId()) .append(",\"title\":\"").append(music.getTitle()) .append("\",\"description\":\"").append(music.getDescription()) .append("\",\"type\":\"").append(music.getType().toString()) .append("\"}").toString(); }

Target:
private String JSON(Music music) { return String.format("{\"id\":%s,\"title\":\"%s\",\"description\":\"%s\",\"type\":\"%s\"}", music.getId(), music.getTitle(), music.getDescription(), music.getType().toString()); }
Source:
public LookupExtractor get() { return new MapLookupExtractor(map, isOneToOne); }

Target:
public LookupExtractor get() { return lookupExtractor; }