auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean addRoute(@NonNull RouteInfo route) { String routeIface = route.getInterface(); if (routeIface != null && !routeIface.equals(mIfaceName)) { throw new IllegalArgumentException( "Route added with non-matching interface: " + routeIface + " vs. " + mIfaceName); } route = routeWithInterface(route); if (!mRoutes.contains(route)) { mRoutes.add(route); return true; } return false; }

Target:
public boolean addRoute(@NonNull RouteInfo route) { String routeIface = route.getInterface(); if (routeIface != null && !routeIface.equals(mIfaceName)) { throw new IllegalArgumentException( "Route added with non-matching interface: " + routeIface + " vs. " + mIfaceName); } route = routeWithInterface(route); int i = findRouteIndexByDestination(route); if (i < 0) { mRoutes.add(route); return true; } else if (mRoutes.get(i).equals(route)) { return false; } else { mRoutes.set(i, route); return true; } }
Source:
public boolean needsUpdate(Diff diff, Object newValue, MergeViewerSide side) { if (canUpdate(diff, side)) { final IEqualityHelper equalityHelper = diff.getMatch().getComparison().getEqualityHelper(); final EObject eObject = MergeViewerUtil.getEObject(diff.getMatch(), side); final EAttribute eAttribute = ((AttributeChange)diff).getAttribute(); final Object oldValue = getStringValue(eObject, eAttribute); return !equalityHelper.matchingAttributeValues(newValue, oldValue); } return false; }

Target:
private boolean needsUpdate(Diff diff, Object newValue, MergeViewerSide side) { final IEqualityHelper equalityHelper = diff.getMatch().getComparison().getEqualityHelper(); final EObject eObject = getTargetObject(diff, side); final EAttribute eAttribute = ((AttributeChange)diff).getAttribute(); final Object oldValue = getStringValue(eObject, eAttribute); return !equalityHelper.matchingAttributeValues(newValue, oldValue); }
Source:
public final Response post(@Context final HttpServletRequest request, @Context final HttpServletResponse response, @Context UriInfo uriInfo, @PathParam("folder") final String folderName, @PathParam("path") final String pathParams, final Map<String, String> properties) { final InitDataObject initDataObject = this.webResource.init (pathParams, false, request, false, null); try { final FileAsset vtlFile = getVTLFile(HTTPMethod.POST, request, folderName, initDataObject.getUser()); final Map<String, Object> contextParams = CollectionsUtils.map( "urlParams", initDataObject.getParamsMap(), "queryParams", uriInfo.getQueryParameters(), "postParams", properties, "user", initDataObject.getUser()); return evalVTLFile(request, response, vtlFile, contextParams, initDataObject.getUser(), getCacheStrategy(HTTPMethod.POST)); } catch(DotContentletStateException e) { final String errorMessage = "Unable to find velocity file '" + HTTPMethod.POST.fileName + FILE_EXTENSION + "' under path '" + VTL_PATH + StringPool.SLASH + folderName + StringPool.SLASH + "'"; Logger.error(this, errorMessage, e); return ResponseUtil.mapExceptionResponse(new DotDataException(errorMessage)); } catch(Exception e) { Logger.error(this,"Exception on VTL endpoint. POST method: " + e.getMessage(), e); return ResponseUtil.mapExceptionResponse(e); } }

Target:
public final Response post(@Context final HttpServletRequest request, @Context final HttpServletResponse response, @Context UriInfo uriInfo, @PathParam("folder") final String folderName, @PathParam("path") final String pathParams, final Map<String, String> properties) { final InitDataObject initDataObject = this.webResource.init (pathParams, false, request, false, null); try { final FileAsset vtlFile = getVTLFile(HTTPMethod.POST, request, folderName, initDataObject.getUser()); final Map<String, Object> contextParams = CollectionsUtils.map( "urlParams", initDataObject.getParamsMap(), "queryParams", uriInfo.getQueryParameters(), "postParams", properties, "user", initDataObject.getUser()); return evalVTLFile(request, response, vtlFile, contextParams, initDataObject.getUser(), getCacheStrategy(HTTPMethod.POST)); } catch(DotContentletStateException e) { final String errorMessage = "Unable to find velocity file '" + HTTPMethod.POST.fileName() + FILE_EXTENSION + "' under path '" + VTL_PATH + StringPool.SLASH + folderName + StringPool.SLASH + "'"; Logger.warn(this, errorMessage, e); return ResponseUtil.mapExceptionResponse(new DotDataException(errorMessage)); } catch(Exception e) { Logger.error(this,"Exception on VTL endpoint. POST method: " + e.getMessage(), e); return ResponseUtil.mapExceptionResponse(e); } }
Source:
protected Map<String, GroupInfo> createGroupInfos() { HashMap<String, GroupInfo> groupInfos = new HashMap<>(); groupInfos.put("aggregate_report_max", createMaxGroupInfo()); groupInfos.put("aggregate_rpt_pct2", createPercentileGroupInfo("aggregate_rpt_pct2", 95, String.format( PERCENTILE_FORMAT, Integer.valueOf(95)))); return groupInfos; }

Target:
protected Map<String, GroupInfo> createGroupInfos() { HashMap<String, GroupInfo> groupInfos = new HashMap<>(); groupInfos.put("aggregate_report_max", createMaxGroupInfo()); LatencyValueSelector valueSelector = new LatencyValueSelector(false); StaticSeriesSelector seriesSelector = new StaticSeriesSelector(); String seriesName = String.format(PERCENTILE_FORMAT, Integer.valueOf(95)); seriesSelector.setSeriesName(seriesName); groupInfos.put(PERCENTILE_PROPERTY, createPercentileGroupInfo(PERCENTILE_PROPERTY, 95, seriesName,valueSelector,seriesSelector)); return groupInfos; }
Source:
private boolean isViolatingMaxNumberOfSessionPerIpPerUser(final Session session) { if (this.maxNumberOfSessionsPerIpPerUser.isPresent()) { final Set<Session> sessionsWithSameIP = this.findSessionsByIP(session.getIp()); int duplicateSessionCount = 0; for (final Session sessionByIP : sessionsWithSameIP) { if (sessionByIP.getUser().equals(session.getUser())) { duplicateSessionCount++; if (duplicateSessionCount >= this.maxNumberOfSessionsPerIpPerUser.get()) { return true; } } } } return false; }

Target:
private boolean isViolatingMaxNumberOfSessionPerIpPerUser(final Session session) { if (this.maxNumberOfSessionsPerIpPerUser.isPresent()) { final int duplicateSessionCount = this.getSessionCountByUserByIP(session.getUser(), session.getIp()); return duplicateSessionCount >= this.maxNumberOfSessionsPerIpPerUser.get(); } return false; }
Source:
public static Optional<Path> getConventionsTestsPath(String child) { try { String conventionTestsDir = System.getProperty(CONVENTION_TESTS_DIR_KEY); if (new File(conventionTestsDir).exists()) { return Optional.of(Paths.get(conventionTestsDir)); } Enumeration<URL> productTestUrls = getSystemResources(conventionTestsDir + "/" + child); Set<URI> productTestUris = new HashSet<>(); while (productTestUrls.hasMoreElements()) { URL url = productTestUrls.nextElement(); productTestUris.add(url.toURI()); } LOGGER.debug("discovered following convention tests uris: {}", productTestUris); if (!productTestUris.isEmpty()) { return Optional.of(copyTestsToTemporaryDirectory(productTestUris, child)); } else { return Optional.empty(); } } catch (IOException e) { throw new RuntimeException(e); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }

Target:
public static Optional<Path> getConventionsTestsPath(String child) { try { ensureTemporaryTestsRootPathExists(); String childLocation = System.getProperty(CONVENTION_TESTS_DIR_KEY) + "/" + child; Path childPath = Paths.get(childLocation); if (Files.exists(childPath)) { Path temporaryChildPath = temporaryTestsRootPath.get().resolve(child); copyRecursive(childPath, temporaryChildPath); return Optional.of(temporaryChildPath); } Enumeration<URL> productTestUrls = getSystemResources(childLocation); Set<URI> productTestUris = new HashSet<>(); while (productTestUrls.hasMoreElements()) { URL url = productTestUrls.nextElement(); productTestUris.add(url.toURI()); } LOGGER.debug("discovered following convention tests uris: {}", productTestUris); if (!productTestUris.isEmpty()) { return Optional.of(copyTestsToTemporaryDirectory(productTestUris, child)); } else { return Optional.empty(); } } catch (IOException e) { throw new RuntimeException(e); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } }
Source:
private static int calcLength(int num) { return (num + 7) / Byte.SIZE; }

Target:
private int calcLength(int num) { return num == 0 ? 0 : (num - 1) / Byte.SIZE + 1; }
Source:
public void setDeviceLifecycleStatus(final String organisationIdentification, final String deviceIdentification, final String correlationUid, final DeviceLifecycleStatus deviceLifecycleStatus) throws FunctionalException { LOGGER.debug("SetDeviceLifecycleStatus called with organisation and device {}", organisationIdentification, deviceIdentification); this.findOrganisation(organisationIdentification); final Device device = this.findDevice(deviceIdentification); device.setDeviceLifecycleStatus(deviceLifecycleStatus); this.deviceDomainService.saveDevice(device); final ResponseMessageResultType result = ResponseMessageResultType.OK; this.webServiceResponseMessageSender.send( new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, result, null)); }

Target:
public void setDeviceLifecycleStatus(final String organisationIdentification, final String deviceIdentification, final String correlationUid, final DeviceLifecycleStatus deviceLifecycleStatus) throws FunctionalException { LOGGER.debug( "SetDeviceLifecycleStatus called with organisation {}, deviceLifecycleStatus and deviceIdentification {}", organisationIdentification, deviceLifecycleStatus.name(), deviceIdentification); this.findOrganisation(organisationIdentification); final Device device = this.deviceDomainService.searchDevice(deviceIdentification); device.setDeviceLifecycleStatus(deviceLifecycleStatus); this.deviceDomainService.saveDevice(device); final ResponseMessageResultType result = ResponseMessageResultType.OK; this.webServiceResponseMessageSender.send( new ResponseMessage(correlationUid, organisationIdentification, deviceIdentification, result, null)); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_landing); Button createAccountButton = (Button) findViewById(R.id.create_account_button); createAccountButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { openChromeCustomTab(true); } }); Button signInButton = (Button) findViewById(R.id.sign_in_button); signInButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { openChromeCustomTab(false); } }); setUpSkipDialog(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean("TOKEN_SAVED", false)) { setContentView(R.layout.activity_landing); getSupportActionBar().hide(); setUpSkipDialog(); setUpButtons(); } else { Intent intent = new Intent(this, MainActivity.class); startActivity(intent); } }
Source:
public void waitForInitialRemoteData_mainThreadThrows() { final SyncUser user = loginUser(); SyncConfiguration config = new SyncConfiguration.Builder(user, Constants.USER_REALM) .waitForInitialRemoteData(false) .build(); Realm realm = null; try { realm = Realm.getInstance(config); fail(); } catch (IllegalStateException ignored) { } finally { if (realm != null) { realm.close(); } } }

Target:
public void waitForInitialRemoteData_mainThreadThrows() { final SyncUser user = loginUser(); SyncConfiguration config = new SyncConfiguration.Builder(user, Constants.USER_REALM) .waitForInitialRemoteData() .build(); Realm realm = null; try { realm = Realm.getInstance(config); fail(); } catch (IllegalStateException ignored) { } finally { if (realm != null) { realm.close(); } } }
Source:
public void onMediaChanged(MediaStore.OnMediaChanged event) { if (isAdded() && !event.isError() && getPostListAdapter() != null) { if (event.mediaList != null && event.mediaList.size() > 0) { MediaModel mediaModel = event.mediaList.get(0); getPostListAdapter().mediaChanged(mediaModel); } } }

Target:
public void onMediaChanged(MediaStore.OnMediaChanged event) { if (isAdded() && !event.isError() && mPostsListAdapter != null) { if (event.mediaList != null && event.mediaList.size() > 0) { MediaModel mediaModel = event.mediaList.get(0); mPostsListAdapter.mediaChanged(mediaModel); } } }
Source:
public String getExtractedToolbarGroupConfiguration() { String toolbarGroupConfiguration = getToolbarGroupConfiguration().trim(); if( !toolbarGroupConfiguration.startsWith( CKEDITOR_CONFIG_TOOLBAR_GROUPS ) || !toolbarGroupConfiguration.endsWith( ";" ) ) { throw new RuntimeException( "Invalid CKEditor toolbarGroups configuration" ); } int equalSignIndex = toolbarGroupConfiguration.indexOf( '=' ); int lastSemicolonIndex = toolbarGroupConfiguration.lastIndexOf( ';' ); return toolbarGroupConfiguration.substring( equalSignIndex + 1, lastSemicolonIndex ).trim(); }

Target:
private String getExtractedToolbarGroupConfiguration() { String toolbarGroupConfiguration = getToolbarGroupConfiguration().trim(); if( !toolbarGroupConfiguration.startsWith( CKEDITOR_CONFIG_TOOLBAR_GROUPS ) || !toolbarGroupConfiguration.endsWith( ";" ) ) { throw new RuntimeException( "Invalid CKEditor toolbarGroups configuration" ); } int equalSignIndex = toolbarGroupConfiguration.indexOf( '=' ); int lastSemicolonIndex = toolbarGroupConfiguration.lastIndexOf( ';' ); return toolbarGroupConfiguration.substring( equalSignIndex + 1, lastSemicolonIndex ).trim(); }
Source:
public void onException(final RxDocumentServiceRequest request, Throwable exception) { checkNotNull(request, "expect non-null request"); checkNotNull(exception, "expect non-null exception"); if (exception instanceof GoneException) { final Throwable cause = exception.getCause(); if (cause != null) { if (cause instanceof IOException) { final Class<?> type = cause.getClass(); if (type == ClosedChannelException.class) { this.onConnectionEvent(RntbdConnectionEvent.READ_EOF, request, exception); } else { if (logger.isDebugEnabled()) { logger.debug("Will not raise the connection state change event for error {}", cause); } } } } } }

Target:
public void onException(final RxDocumentServiceRequest request, Throwable exception) { checkNotNull(request, "expect non-null request"); checkNotNull(exception, "expect non-null exception"); if (exception instanceof GoneException) { final Throwable cause = exception.getCause(); if (cause != null) { if (cause instanceof IOException) { if (cause instanceof ClosedChannelException) { this.onConnectionEvent(RntbdConnectionEvent.READ_EOF, request, exception); } else { if (logger.isDebugEnabled()) { logger.debug("Will not raise the connection state change event for error {}", cause); } } } } } }
Source:
public Map<StoreKey, ArtifactStore> getArtifactStoresByKey() { Map<StoreKey, ArtifactStore> ret = new HashMap<>(); stores.getCache().forEach( ( k, v ) -> { ArtifactStore store = readValueByJson( v, StoreKey.fromString( k ) ); if ( store != null ) { ret.put( store.getKey(), store ); } } ); return ret; }

Target:
public Map<StoreKey, ArtifactStore> getArtifactStoresByKey() { return stores.executeCache( c -> { Map<StoreKey, ArtifactStore> ret = new HashMap<>(); c.forEach( ( k, v ) -> { ArtifactStore store = readValueByJson( v, k ); if ( store != null ) { ret.put( store.getKey(), store ); } } ); return ret; } ); }
Source:
public void suggestTime(@NonNull TimeSignal timeSignal) { enforceSetTimePermission(); Objects.requireNonNull(timeSignal); mHandler.post(() -> mTimeDetectorStrategy.suggestTime(timeSignal)); }

Target:
public void suggestTime(@NonNull TimeSignal timeSignal) { enforceSetTimePermission(); Objects.requireNonNull(timeSignal); long idToken = Binder.clearCallingIdentity(); try { synchronized (mStrategyLock) { mTimeDetectorStrategy.suggestTime(timeSignal); } } finally { Binder.restoreCallingIdentity(idToken); } }
Source:
private void pruneDeadThumbnailFiles() { HashSet<String> existingFiles = new HashSet<String>(); String directory = "/sdcard/DCIM/.thumbnails"; String files = (new File(directory)).list(); if (files == null) files = new String[0]; for (int i = 0; i < files.length; i++) { String fullPathString = directory + "/" + files[i]; existingFiles.add(fullPathString); } try { Cursor c = mMediaProvider.query( mThumbsUri, new String { "_data" }, null, null, null); Log.v(TAG, "pruneDeadThumbnailFiles... " + c); if (c != null && c.moveToFirst()) { do { String fullPathString = c.getString(0); existingFiles.remove(fullPathString); } while (c.moveToNext()); } for (String fileToDelete : existingFiles) { if (Config.LOGV) Log.v(TAG, "fileToDelete is " + fileToDelete); try { if (!fileToDelete.contains(".thumbdata")) { (new File(fileToDelete)).delete(); } } catch (SecurityException ex) { } } Log.v(TAG, "/pruneDeadThumbnailFiles... " + c); if (c != null) { c.close(); } } catch (RemoteException e) { } }

Target:
private void pruneDeadThumbnailFiles() { HashSet<String> existingFiles = new HashSet<String>(); String directory = "/sdcard/DCIM/.thumbnails"; String[] files = (new File(directory)).list(new FilenameFilter() { public boolean accept(File dir, String filename) { return filename.toLowerCase().endsWith(".jpg") || filename.toLowerCase().endsWith(".jpeg"); } }); if (files == null) files = new String[0]; for (int i = 0; i < files.length; i++) { String fullPathString = directory + "/" + files[i]; existingFiles.add(fullPathString); } try { Cursor c = mMediaProvider.query( mThumbsUri, new String { "_data" }, null, null, null); Log.v(TAG, "pruneDeadThumbnailFiles... " + c); if (c != null && c.moveToFirst()) { do { String fullPathString = c.getString(0); existingFiles.remove(fullPathString); } while (c.moveToNext()); } for (String fileToDelete : existingFiles) { if (Config.LOGV) Log.v(TAG, "fileToDelete is " + fileToDelete); try { (new File(fileToDelete)).delete(); } catch (SecurityException ex) { } } Log.v(TAG, "/pruneDeadThumbnailFiles... " + c); if (c != null) { c.close(); } } catch (RemoteException e) { } }
Source:
@Override protected void finalize() throws Throwable { try { close(); if (mCookie != null) { throw new AssertionError("Failed to close dex file in finalizer."); } mCookie = null; } finally { super.finalize(); } }

Target:
@Override protected void finalize() throws Throwable { try { close(); synchronized (this) { if (mCookie != null) { throw new AssertionError("Failed to close dex file in finalizer."); } mCookie = null; } } finally { super.finalize(); } }
Source:
private int getBlockFromCompletedQueue(final AbfsInputStream stream, final long position, final int length, final byte[] buffer) throws IOException { ReadBuffer buf = getBufferFromCompletedQueue(stream, position); if (buf == null) { return 0; } if (buf.getStatus() == ReadBufferStatus.READ_FAILED) { if ((currentTimeMillis() - (buf.getTimeStamp()) < THRESHOLD_AGE_MILLISECONDS)) { throw buf.getErrException(); } else { return 0; } } if ((buf.getStatus() != ReadBufferStatus.AVAILABLE) || (position >= buf.getOffset() + buf.getLength())) { return 0; } int cursor = (int) (position - buf.getOffset()); int availableLengthInBuffer = buf.getLength() - cursor; int lengthToCopy = Math.min(length, availableLengthInBuffer); System.arraycopy(buf.getBuffer(), cursor, buffer, 0, lengthToCopy); if (cursor == 0) { buf.setFirstByteConsumed(true); } if (cursor + lengthToCopy == buf.getLength()) { buf.setLastByteConsumed(true); } buf.setAnyByteConsumed(true); return lengthToCopy; }

Target:
private int getBlockFromCompletedQueue(final AbfsInputStream stream, final long position, final int length, final byte[] buffer) throws IOException { ReadBuffer buf = getBufferFromCompletedQueue(stream, position); if (buf == null) { return 0; } if (buf.getStatus() == ReadBufferStatus.READ_FAILED) { if ((currentTimeMillis() - (buf.getTimeStamp()) < thresholdAgeMilliseconds)) { throw buf.getErrException(); } else { return 0; } } if ((buf.getStatus() != ReadBufferStatus.AVAILABLE) || (position >= buf.getOffset() + buf.getLength())) { return 0; } int cursor = (int) (position - buf.getOffset()); int availableLengthInBuffer = buf.getLength() - cursor; int lengthToCopy = Math.min(length, availableLengthInBuffer); System.arraycopy(buf.getBuffer(), cursor, buffer, 0, lengthToCopy); if (cursor == 0) { buf.setFirstByteConsumed(true); } if (cursor + lengthToCopy == buf.getLength()) { buf.setLastByteConsumed(true); } buf.setAnyByteConsumed(true); return lengthToCopy; }
Source:
private void updateVersionMetadata(String filePath, Version version, DescriptorLanguage type, String repositoryId) { Set<SourceFile> sourceFiles = version.getSourceFiles(); String branch = version.getName(); if (Strings.isNullOrEmpty(filePath)) { String message = String.format("%s : No descriptor found for %s.", repositoryId, branch); LOG.info(message); } if (sourceFiles == null || sourceFiles.isEmpty()) { String message = String.format("%s : Error getting descriptor for %s with path %s", repositoryId, branch, filePath); LOG.info(message); if (version.getReference() != null) { String readmeContent = getREADMEContent(repositoryId, version.getReference()); if (readmeContent != null && !readmeContent.isBlank()) { version.setDescriptionAndDescriptionSource(readmeContent, DescriptionSource.README); } } return; } String fileContent; Optional<SourceFile> first = sourceFiles.stream().filter(file -> file.getPath().equals(filePath)).findFirst(); if (first.isPresent()) { fileContent = first.get().getContent(); LanguageHandlerInterface anInterface = LanguageHandlerFactory.getInterface(type); try { anInterface.parseWorkflowContent(filePath, fileContent, sourceFiles, version); } catch (StackOverflowError e) { LOG.error("Problems parsing workflow"); } if ((version.getDescription() == null || version.getDescription().isEmpty()) && version.getReference() != null) { String readmeContent = getREADMEContent(repositoryId, version.getReference()); if (readmeContent != null && !readmeContent.isBlank()) { version.setDescriptionAndDescriptionSource(readmeContent, DescriptionSource.README); } } } }

Target:
private void updateVersionMetadata(String filePath, Version version, DescriptorLanguage type, String repositoryId) { Set<SourceFile> sourceFiles = version.getSourceFiles(); String branch = version.getName(); if (Strings.isNullOrEmpty(filePath)) { String message = String.format("%s : No descriptor found for %s.", repositoryId, branch); LOG.info(message); } if (sourceFiles == null || sourceFiles.isEmpty()) { String message = String.format("%s : Error getting descriptor for %s with path %s", repositoryId, branch, filePath); LOG.info(message); if (version.getReference() != null) { String readmeContent = getREADMEContent(repositoryId, version.getReference()); if (StringUtils.isNotBlank(readmeContent)) { version.setDescriptionAndDescriptionSource(readmeContent, DescriptionSource.README); } } return; } String fileContent; Optional<SourceFile> first = sourceFiles.stream().filter(file -> file.getPath().equals(filePath)).findFirst(); if (first.isPresent()) { fileContent = first.get().getContent(); LanguageHandlerInterface anInterface = LanguageHandlerFactory.getInterface(type); try { anInterface.parseWorkflowContent(filePath, fileContent, sourceFiles, version); } catch (StackOverflowError e) { LOG.error("Problems parsing workflow"); } if ((version.getDescription() == null || version.getDescription().isEmpty()) && version.getReference() != null) { String readmeContent = getREADMEContent(repositoryId, version.getReference()); if (StringUtils.isNotBlank(readmeContent)) { version.setDescriptionAndDescriptionSource(readmeContent, DescriptionSource.README); } } } }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); if (!(selection instanceof IStructuredSelection)) { return null; } final Iterator<Object> iterator = ((IStructuredSelection) selection).iterator(); if (!selection.isEmpty()) { while (iterator.hasNext()) { Object element = iterator.next(); if (element instanceof TmfTraceElement) { TmfTraceElement trace = (TmfTraceElement) element; refreshTrace(trace); } else if (element instanceof TmfTraceFolder) { TmfTraceFolder tmfTraceFolder = (TmfTraceFolder) element; for (TmfTraceElement e : tmfTraceFolder.getTraces()) { refreshTrace(e); } } else if (element instanceof ITmfEvent) { ITmfEvent iTmfEvent = (ITmfEvent) element; refreshTrace(iTmfEvent.getTrace()); } } } else { IEditorPart activeEditor = HandlerUtil.getActiveEditorChecked(event); if (activeEditor instanceof ITmfTraceEditor) { ITmfTrace trace = ((ITmfTraceEditor) activeEditor).getTrace(); refreshTrace(trace); } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { ISelection selection = HandlerUtil.getCurrentSelection(event); if (!(selection instanceof IStructuredSelection)) { return null; } final Iterator<Object> iterator = ((IStructuredSelection) selection).iterator(); boolean refreshed = false; while (iterator.hasNext()) { Object element = iterator.next(); if (element instanceof TmfTraceElement) { TmfTraceElement trace = (TmfTraceElement) element; refreshTrace(trace); refreshed = true; } } if (refreshed) { return null; } IEditorPart activeEditor = HandlerUtil.getActiveEditorChecked(event); if (activeEditor instanceof ITmfTraceEditor) { ITmfTrace trace = ((ITmfTraceEditor) activeEditor).getTrace(); refreshTrace(trace); } return null; }
Source:
public Stream<P> streamByPage() { return pagedFluxBase.byPage().toStream(1); }

Target:
public Stream<P> streamByPage() { return pagedFluxBase.byPage().toStream(DEFAULT_BATCH_SIZE); }
Source:
protected void setupEventRouting(EventRouting<String> routing) { super.setupEventRouting(routing); routing.route(NumberAdded.class, (EventRoute<String, NumberAdded>) (message, context) -> ImmutableSet.of(message.getCalculatorId())); }

Target:
protected void setupEventRouting(EventRouting<String> routing) { super.setupEventRouting(routing); routing.route(NumberAdded.class, (message, context) -> withId(message.getCalculatorId())); }
Source:
public void operationComplete(final ChannelFuture future) { final ImapCommandEntry entry = requestsQueue.peek(); if (entry != null) { entry.setState(ImapCommandEntry.CommandState.SENT); } if (!future.isSuccess()) { handleChannelException(new ImapAsyncClientException(FailureType.WRITE_TO_SERVER_FAILED, future.cause())); } }

Target:
public void operationComplete(final ChannelFuture future) { final ImapCommandEntry entry = requestsQueue.peek(); if (entry != null) { entry.setState(ImapCommandEntry.CommandState.REQUEST_SENT); } if (!future.isSuccess()) { handleChannelException(new ImapAsyncClientException(FailureType.WRITE_TO_SERVER_FAILED, future.cause())); } }
Source:
public synchronized boolean isRegistered() { return boundedContextName != null; }

Target:
public boolean isRegistered() { return boundedContextName != null; }
Source:
public static void getThreadsFromLabel(final String label, final OnThreadsReady listener){ new AsyncTask<Void, Void, List<MailThread>>() { @Override protected List<MailThread> doInBackground(Void... params) { List<MailThread> threads = getAllThreads(); List<MailThread> res = new ArrayList<>(); for (MailThread thread : threads) { String[] labels = thread.labels.split(";"); if (thread.getLastMailFromLabel(label.toUpperCase())!=null) { res.add(thread); } } return res; } @Override protected void onPostExecute(List<MailThread> mailThreads) { super.onPostExecute(mailThreads); listener.threads(mailThreads); } }.execute(); }

Target:
public static void getThreadsFromLabel(final String label, final OnThreadsReady listener){ new AsyncTask<Void, Void, List<MailThread>>() { @Override protected List<MailThread> doInBackground(Void... params) { List<MailThread> threads = getAllThreads(); List<MailThread> res = new ArrayList<>(); for (MailThread thread : threads) { if (thread.getLastMailFromLabel(label.toUpperCase())!=null) { res.add(thread); } } return res; } @Override protected void onPostExecute(List<MailThread> mailThreads) { super.onPostExecute(mailThreads); listener.threads(mailThreads); } }.execute(); }
Source:
public void afterFailure(Throwable t) { processors.forEach(sp -> { if (sp.getLeft().equals(processor)) { if (sp.getRight() != null) { sp.getRight().close(); } processors.remove(sp); } }); if (failure.compareAndSet(null, t)) { processors.forEach(sp -> { sp.getLeft().stop(); if (sp.getRight() != null) { sp.getRight().close(); } }); } handleProcessorShutdown(t); }

Target:
public void afterFailure(Throwable t) { closeAndRemoveProcessor(); if (failure.compareAndSet(null, t)) { processors.forEach(sp -> { sp.getLeft().stop(); if (sp.getRight() != null) { sp.getRight().close(); } }); } handleProcessorShutdown(t); }
Source:
public void testBug243422() { IMetadataRepositoryManager repoMan = getAgent().getService(IMetadataRepositoryManager.class); assertNotNull(repoMan); File site = getTestData("Update site", "/testData/updatesite/UpdateSite243422/"); IMetadataRepository metadataRepo = null; try { metadataRepo = repoMan.loadRepository(site.toURI(), null); } catch (ProvisionException e) { fail("Can't load repository UpdateSite243422"); } IQuery<IInstallableUnit> query = QueryUtil.createIUQuery("org.eclipse.jdt.astview.feature.feature.group", Version.create("1.0.1")); IQueryResult<IInstallableUnit> result = metadataRepo.query(query, null); assertEquals("1.0", 1, queryResultSize(result)); IInstallableUnit featureIU = result.iterator().next(); Collection<IRequirement> required = featureIU.getRequirements(); for (IRequirement iRequirement : required) { IRequiredCapability req = (IRequiredCapability) iRequirement; if (req.getName().equals("org.eclipse.ui.ide")) { assertEquals("2.0", VersionRange.emptyRange, req.getRange()); } } }

Target:
public void testBug243422() { IMetadataRepositoryManager repoMan = getAgent().getService(IMetadataRepositoryManager.class); assertNotNull(repoMan); File site = getTestData("Update site", "/testData/updatesite/UpdateSite243422/"); IMetadataRepository metadataRepo = null; try { metadataRepo = repoMan.loadRepository(site.toURI(), null); } catch (ProvisionException e) { fail("Can't load repository UpdateSite243422"); } IQuery<IInstallableUnit> query = QueryUtil.createIUQuery("org.eclipse.jdt.astview.feature.feature.group", Version.create("1.0.1")); IQueryResult<IInstallableUnit> result = metadataRepo.query(query, null); assertEquals("1.0", 1, queryResultSize(result)); IInstallableUnit featureIU = result.iterator().next(); for (IRequirement requirement : featureIU.getRequirements()) { IRequiredCapability req = (IRequiredCapability) requirement; if (req.getName().equals("org.eclipse.ui.ide")) { assertEquals("2.0", VersionRange.emptyRange, req.getRange()); } } }
Source:
private void addMandatoryGoals(User userEntity) { for (ActivityCategoryDTO activityCategory : activityCategoryService.getAllActivityCategories()) { if (activityCategory.isMandatoryNoGo()) { userEntity.getAnonymized().addGoal( BudgetGoal.createNoGoInstance(ActivityCategory.getRepository().findOne(activityCategory.getID()))); } } }

Target:
private void addMandatoryGoals(User userEntity) { activityCategoryService.getAllActivityCategories().stream().filter(c -> c.isMandatoryNoGo()) .forEach(c -> addGoal(userEntity, c)); }
Source:
static CaseMetadata getCaseMetadataFromCaseDirectoryPath(Path caseDirectoryPath) throws CaseMetadata.CaseMetadataException { CaseMetadata caseMetadata = null; File directory = new File(caseDirectoryPath.toString()); if (directory.isDirectory()) { String fileNamePrefix = directory.getName(); if (TimeStampUtils.endsWithTimeStamp(fileNamePrefix)) { fileNamePrefix = fileNamePrefix.substring(0, fileNamePrefix.length() - TimeStampUtils.getTimeStampLength()); } File file = new File(directory + "/" + fileNamePrefix + CaseMetadata.getFileExtension()); if(file.isFile()) { caseMetadata = new CaseMetadata(Paths.get(file.getAbsolutePath())); } } return caseMetadata; }

Target:
private static CaseMetadata getCaseMetadataFromCaseDirectoryPath(Path caseDirectoryPath) throws CaseMetadata.CaseMetadataException, MultiUserCaseException { CaseMetadata caseMetadata = null; File directory = new File(caseDirectoryPath.toString()); if (directory.isDirectory()) { String fileNamePrefix = directory.getName(); if (TimeStampUtils.endsWithTimeStamp(fileNamePrefix)) { fileNamePrefix = fileNamePrefix.substring(0, fileNamePrefix.length() - TimeStampUtils.getTimeStampLength()); } File autFile = null; for (File file : directory.listFiles()) { if (file.getName().toLowerCase().endsWith(CaseMetadata.getFileExtension()) && file.isFile()) { autFile = file; break; } } if(autFile == null || !autFile.isFile()) { throw new MultiUserCaseException(String.format("No case metadata (.aut) file found in the case directory '%s'.", caseDirectoryPath.toString())); } caseMetadata = new CaseMetadata(Paths.get(autFile.getAbsolutePath())); } return caseMetadata; }
Source:
public Attribute fillAttribute(PerunSessionImpl perunSession, User user, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException { Attribute filledAttribute = new Attribute(attribute); if (generatedNamespaces.contains(attribute.getFriendlyNameParameter())) { ModulesUtilsBlImpl.LoginGenerator generator = new ModulesUtilsBlImpl.LoginGenerator(); String login = generator.generateLogin(user, new ModulesUtilsBlImpl.LoginGenerator.LoginGeneratorFunction() { @Override public String generateLogin(String firstName, String lastName) { String login = firstName+ "." + lastName; if (login.length()>20) { login = login.substring(0, 20); } return login; } }); if (login == null) return filledAttribute; int iterator = 0; while (iterator >= 0) { if (iterator > 0) { int iteratorLength = String.valueOf(iterator).length(); if (login.length() + iteratorLength > 20) { login = login.substring(0, login.length()-1); iterator = 0; filledAttribute.setValue(login); } else { filledAttribute.setValue(login + iterator); } } else { filledAttribute.setValue(login); } try { checkAttributeValue(perunSession, user, filledAttribute); return filledAttribute; } catch (WrongAttributeValueException ex) { iterator++; } } return filledAttribute; } else { return filledAttribute; } }

Target:
public Attribute fillAttribute(PerunSessionImpl perunSession, User user, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException { Attribute filledAttribute = new Attribute(attribute); if (generatedNamespaces.contains(attribute.getFriendlyNameParameter())) { ModulesUtilsBlImpl.LoginGenerator generator = new ModulesUtilsBlImpl.LoginGenerator(); String login = generator.generateLogin(user, new ModulesUtilsBlImpl.LoginGenerator.LoginGeneratorFunction() { @Override public String generateLogin(String firstName, String lastName) { if (firstName == null || firstName.isEmpty() || lastName == null || lastName.isEmpty()) { return "eduteams-user"; } String login = firstName+ "." + lastName; if (login.length()>20) { login = login.substring(0, 20); } return login; } }); if (login == null) return filledAttribute; int iterator = 0; while (iterator >= 0) { if (iterator > 0) { int iteratorLength = String.valueOf(iterator).length(); if (login.length() + iteratorLength > 20) { login = login.substring(0, login.length()-1); iterator = 0; filledAttribute.setValue(login); } else { filledAttribute.setValue(login + iterator); } } else { filledAttribute.setValue(login); } try { checkAttributeValue(perunSession, user, filledAttribute); return filledAttribute; } catch (WrongAttributeValueException ex) { iterator++; } } return filledAttribute; } else { return filledAttribute; } }
Source:
public void start() throws InstantiationException { long startupBeginTime = System.currentTimeMillis(); idConverter = idConverterFactory.getIdConverter(); securityService = securityServiceFactory.getSecurityService(); getPeersHandler = new GetPeersHandler(clusterMap, securityService, frontendMetrics); getSignedUrlHandler = new GetSignedUrlHandler(urlSigningService, securityService, idConverter, accountAndContainerInjector, frontendMetrics, clusterMap, clusterName, frontendConfig); postBlobHandler = new PostBlobHandler(securityService, idConverter, idSigningService, router, accountAndContainerInjector, SystemTime.getInstance(), frontendConfig, frontendMetrics); ttlUpdateHandler = new TtlUpdateHandler(router, securityService, idConverter, accountAndContainerInjector, frontendMetrics, clusterMap, clusterName, frontendConfig); getClusterMapSnapshotHandler = new GetClusterMapSnapshotHandler(securityService, frontendMetrics, clusterMap); getAccountsHandler = new GetAccountsHandler(securityService, accountService, frontendMetrics); postAccountsHandler = new PostAccountsHandler(securityService, accountService, frontendConfig, frontendMetrics); isUp = true; logger.info("AmbryBlobStorageService has started"); frontendMetrics.blobStorageServiceStartupTimeInMs.update(System.currentTimeMillis() - startupBeginTime); }

Target:
public void start() throws InstantiationException { long startupBeginTime = System.currentTimeMillis(); idConverter = idConverterFactory.getIdConverter(); securityService = securityServiceFactory.getSecurityService(); getPeersHandler = new GetPeersHandler(clusterMap, securityService, frontendMetrics); getSignedUrlHandler = new GetSignedUrlHandler(urlSigningService, securityService, idConverter, accountAndContainerInjector, frontendMetrics, clusterMap); postBlobHandler = new PostBlobHandler(securityService, idConverter, idSigningService, router, accountAndContainerInjector, SystemTime.getInstance(), frontendConfig, frontendMetrics, clusterName); ttlUpdateHandler = new TtlUpdateHandler(router, securityService, idConverter, accountAndContainerInjector, frontendMetrics, clusterMap); getClusterMapSnapshotHandler = new GetClusterMapSnapshotHandler(securityService, frontendMetrics, clusterMap); getAccountsHandler = new GetAccountsHandler(securityService, accountService, frontendMetrics); postAccountsHandler = new PostAccountsHandler(securityService, accountService, frontendConfig, frontendMetrics); isUp = true; logger.info("AmbryBlobStorageService has started"); frontendMetrics.blobStorageServiceStartupTimeInMs.update(System.currentTimeMillis() - startupBeginTime); }
Source:
public void processDir(String contentDirectory) throws Exception { log.info("Checking for a META-INF directory in {}", contentDirectory); String metaDir = new File(contentDirectory, "META-INF").getAbsoluteFile().getAbsolutePath(); if(metaDir != null) { if(processors != null) { boolean failed = false; log.info("Running processor[s] for directory", processors.size(), metaDir); for(ConfigProcessor processor : processors) { try { log.info("Running {}", processor.getClass().getName()); processor.processFromDirectory(metaDir); } catch(IOException e) { throw e; } catch(Exception e) { throw e; } } } else { log.warn("No config processors exist in this context"); } } }

Target:
public void processDir(String contentDirectory) throws Exception { log.info("Checking for a META-INF directory in {}", contentDirectory); String metaDir = new File(contentDirectory, "META-INF").getAbsoluteFile().getAbsolutePath(); if(metaDir != null) { if(processors != null) { log.info("Running processor[s] for directory", processors.size(), metaDir); for(ConfigProcessor processor : processors) { log.info("Running {}", processor.getClass().getName()); processor.processFromDirectory(metaDir); } } else { log.warn("No config processors exist in this context"); } } }
Source:
private void applyFlatPresentation() { ITmfTrace parentTrace = getTrace(); synchronized (fFlatTraces) { fFlatTraces.add(parentTrace); for (ITmfTrace trace : TmfTraceManager.getTraceSet(parentTrace)) { final ITmfStateSystem ss = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID); List<@NonNull TimeGraphEntry> entryList = getEntryList(ss); if (entryList != null) { for (TimeGraphEntry traceEntry : entryList) { hierarchicalToFlatTree(traceEntry); } } } } }

Target:
private void applyFlatPresentation() { ITmfTrace parentTrace = getTrace(); synchronized (fFlatTraces) { fFlatTraces.add(parentTrace); List<@NonNull TimeGraphEntry> entryList = getEntryList(parentTrace); if (entryList != null) { for (TimeGraphEntry traceEntry : entryList) { hierarchicalToFlatTree(traceEntry); } } } }
Source:
public void run() { BufferedSource in = null; try { in = Okio.buffer(Okio.source(mClient.getInputStream())); final String request = in.readUtf8Line(); String command; String parameters; int index = request.indexOf(' '); if (index == -1) { command = request; parameters = ""; } else { command = request.substring(0, index); parameters = request.substring(index + 1); } boolean result; if (COMMAND_PROTOCOL_VERSION.equalsIgnoreCase(command)) { result = writeValue(mClient, VALUE_PROTOCOL_VERSION); } else if (COMMAND_SERVER_VERSION.equalsIgnoreCase(command)) { result = writeValue(mClient, VALUE_SERVER_VERSION); } else if (COMMAND_WINDOW_MANAGER_LIST.equalsIgnoreCase(command)) { result = listWindows(mClient); } else if (COMMAND_WINDOW_MANAGER_GET_FOCUS.equalsIgnoreCase(command)) { result = getFocusedWindow(mClient); } else if (COMMAND_WINDOW_MANAGER_AUTOLIST.equalsIgnoreCase(command)) { result = windowManagerAutolistLoop(); } else { result = windowCommand(mClient, command, parameters); } if (!result) { Log.w(LOG_TAG, "An error occurred with the command: " + command); } } catch (IOException e) { Log.w(LOG_TAG, "Connection error: ", e); } finally { if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); } } if (mClient != null) { try { mClient.close(); } catch (IOException e) { e.printStackTrace(); } } } }

Target:
public void run() { BufferedSource in = null; try { in = Okio.buffer(Okio.source(mClient)); final String request = in.readUtf8Line(); String command; String parameters; int index = request.indexOf(' '); if (index == -1) { command = request; parameters = ""; } else { command = request.substring(0, index); parameters = request.substring(index + 1); } boolean result; if (COMMAND_PROTOCOL_VERSION.equalsIgnoreCase(command)) { result = writeValue(mClient, VALUE_PROTOCOL_VERSION); } else if (COMMAND_SERVER_VERSION.equalsIgnoreCase(command)) { result = writeValue(mClient, VALUE_SERVER_VERSION); } else if (COMMAND_WINDOW_MANAGER_LIST.equalsIgnoreCase(command)) { result = listWindows(mClient); } else if (COMMAND_WINDOW_MANAGER_GET_FOCUS.equalsIgnoreCase(command)) { result = getFocusedWindow(mClient); } else if (COMMAND_WINDOW_MANAGER_AUTOLIST.equalsIgnoreCase(command)) { result = windowManagerAutolistLoop(); } else { result = windowCommand(mClient, command, parameters); } if (!result) { Log.w(LOG_TAG, "An error occurred with the command: " + command); } } catch (IOException e) { Log.w(LOG_TAG, "Connection error: ", e); } finally { if (in != null) { try { in.close(); } catch (IOException e) { e.printStackTrace(); } } if (mClient != null) { try { mClient.close(); } catch (IOException e) { e.printStackTrace(); } } } }
Source:
public void obtainsCreationDate() throws Exception { final User user = NbRule.get(); final Alias alias = user.aliases().iterate().iterator().next(); final Inbox inbox = alias.inbox(); final Bout bout = inbox.bout(inbox.start()); final Attachments attachments = bout.attachments(); final long before = System.currentTimeMillis(); final String name = "attach-name"; attachments.create(name); final Attachment attachment = attachments.get(name); MatcherAssert.assertThat( attachment.date().getTime(), Matchers.greaterThan(before) ); final long after = System.currentTimeMillis(); MatcherAssert.assertThat( attachment.date().getTime(), Matchers.lessThan(after) ); attachments.delete(name); }

Target:
public void obtainsCreationDate() throws Exception { final Alias alias = NbRule.get().aliases().iterate().iterator().next(); final Inbox inbox = alias.inbox(); final Attachments attachments = inbox.bout(inbox.start()).attachments(); final long before = System.currentTimeMillis(); final String name = "attach-name"; attachments.create(name); final Attachment attachment = attachments.get(name); MatcherAssert.assertThat( attachment.date().getTime(), Matchers.greaterThanOrEqualTo(before) ); final long after = System.currentTimeMillis(); MatcherAssert.assertThat( attachment.date().getTime(), Matchers.lessThanOrEqualTo(after) ); attachments.delete(name); }
Source:
public boolean savePageFor(@NonNull ReadingListPageDiskRow row) { final PageTitle title = makeTitleFrom(row); if (title == null) { return false; } Page page = getApiService(title).pageCombo(title.getPrefixedText(), !WikipediaApp.getInstance().isImageDownloadEnabled()).toPage(title); try { SavedPage savedPage = new SavedPage(page.getTitle()); savedPage.writeToFileSystem(page); final ImageUrlMap imageUrlMap = new ImageUrlMap.Builder(savedPage.getBaseDir()) .extractUrls(page).build(); downloadImages(imageUrlMap); savedPage.writeUrlMap(imageUrlMap.toJSON()); L.i("Page " + title.getDisplayText() + " saved!"); return true; } catch (IOException e) { L.e("Failed to save page " + title.getDisplayText(), e); return false; } }

Target:
public boolean savePageFor(@NonNull ReadingListPageDiskRow row) { final PageTitle title = makeTitleFrom(row); if (title == null) { return false; } final Page page = getApiService(title).pageCombo(title.getPrefixedText(), !WikipediaApp.getInstance().isImageDownloadEnabled()).toPage(title); final SavedPage savedPage = new SavedPage(page.getTitle()); final ImageUrlMap imageUrlMap = new ImageUrlMap.Builder(savedPage.getBaseDir()) .extractUrls(page).build(); try { savedPage.writeToFileSystem(page); downloadImages(imageUrlMap); savedPage.writeUrlMap(imageUrlMap.toJSON()); L.i("Page " + title.getDisplayText() + " saved!"); return true; } catch (IOException e) { L.e("Failed to save page " + title.getDisplayText(), e); return false; } }
Source:
public IkeSaPayload( boolean isResp, boolean isIkeSa, byte spiSize, long[] spis, SaProposal[] saProposals) { super(IkePayload.PAYLOAD_TYPE_SA, false); if (saProposals.length < 1 || isResp && (saProposals.length > 1) || saProposals.length != spis.length) { throw new IllegalArgumentException("Invalid SA payload."); } isSaResponse = isResp; proposalList = new LinkedList<Proposal>(); int protocolId = isIkeSa ? PROTOCOL_ID_IKE : PROTOCOL_ID_ESP; for (int i = 0; i < saProposals.length; i++) { Proposal proposal = new Proposal( (byte) (i + 1), protocolId, spiSize, spis[i], saProposals[i], false ); proposalList.add(proposal); } }

Target:
public IkeSaPayload( boolean isResp, boolean isIkeSa, byte spiSize, long[] spis, SaProposal[] saProposals) { super(IkePayload.PAYLOAD_TYPE_SA, false); if (saProposals.length < 1 || isResp && (saProposals.length > 1) || saProposals.length != spis.length) { throw new IllegalArgumentException("Invalid SA payload."); } isSaResponse = isResp; proposalList = new ArrayList<Proposal>(saProposals.length); int protocolId = isIkeSa ? PROTOCOL_ID_IKE : PROTOCOL_ID_ESP; for (int i = 0; i < saProposals.length; i++) { Proposal proposal = new Proposal( (byte) (i + 1) , protocolId, spiSize, spis[i], saProposals[i], false ); proposalList.add(proposal); } }
Source:
public String toString(Object value) { if (value == null) { return null; } if (!value.getClass().isArray()) { throw new RuntimeException(Messages.MESSAGES.expectedArray(value.getClass().getName())); } Object[] values = new Object[Array.getLength(value)]; if (values.length == 0) { return ""; } if (rawType.getComponentType().isPrimitive()) { copyPrimitiveArray(values, value); } else { values = (Object[]) value; } return stringify(values); }

Target:
public String toString(Object value) { if (value == null) { return null; } if (!value.getClass().isArray()) { throw new RuntimeException(Messages.MESSAGES.expectedArray(value.getClass().getName())); } Object[] values = new Object[Array.getLength(value)]; if (values.length == 0) { return ""; } if (rawType.getComponentType().isPrimitive()) { copyPrimitiveArray(values, value); } else { values = (Object[]) value; } return stringify(Arrays.asList(values)); }