auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> protected static void goToCorrectStart(RandomAccessFile <END> rafile) throws IOException { String line = rafile.readLine(); if (line.startsWith("{\"data\":")) { rafile.seek(46); } else if (line.startsWith("{\"traceEvents\":")) { rafile.seek(14); } else { rafile.seek(0); } }</code><technical_language>abstract public public a default implementation move specific implementation in child classes</technical_language>

Target:
public abstract void goToCorrectStart(RandomAccessFile rafile) throws IOException; public abstract String getTraceType(); public abstract String getTsKey(); public abstract Integer getBracketsToSkip(); @Override public void initTrace(IResource resource, String path, Class<? extends ITmfEvent> type) throws TmfTraceException { super.initTrace(resource, path, type); fProperties.put("Type", getTraceType()); String dir = TmfTraceManager.getSupplementaryFileDir(this); fFile = new File(dir + new File(path).getName()); if (!fFile.exists()) { Job sortJob = new SortingJob(this, path, getTsKey(), getBracketsToSkip()); sortJob.schedule(); while (sortJob.getResult() == null) { try { sortJob.join(); } catch (InterruptedException e) { throw new TmfTraceException(e.getMessage(), e); } } IStatus result = sortJob.getResult(); if (!result.isOK()) { throw new TmfTraceException("Job failed " + result.getMessage()); } } try { fFileInput = new BufferedRandomAccessFile(fFile, "r"); goToCorrectStart(fFileInput); } catch (IOException e) { throw new TmfTraceException(e.getMessage(), e); } }
Source:
<code>private Func1<String, Observable<Channel>> createChannelInstanceFromPath() { return new Func1<String, Observable<Channel>>() { @Override public Observable<Channel> call(final String channelPath) { return Observable.create(new Observable.OnSubscribe<ChannelInfo>() { @Override public void call(final Subscriber<? super ChannelInfo> subscriber) { channelsDB.child(channelPath).addListenerForSingleValueEvent(new ValueEventListener() { @Override public void onDataChange(DataSnapshot dataSnapshot) { if (dataSnapshot.hasChildren()) { subscriber.onNext(toChannelInfo(dataSnapshot)); } <START> subscriber.onCompleted(); <END> } @Override public void onCancelled(DatabaseError databaseError) { subscriber.onError(databaseError.toException()); } }); } }).map(createChannelInstanceWith(channelPath)); } }; }</code><technical_language>deep! extract some of this stuff</technical_language>

Target:
private Func1<String, Observable<Channel>> createChannelInstanceFromPath() { return new Func1<String, Observable<Channel>>() { @Override public Observable<Channel> call(String channelPath) { return getChannelInfoFor(channelPath) .map(createChannelInstanceWith(channelPath)); } }; }
Source:
<code>public void testToStreamRecordV2WhenOldImageIsNull() { com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord = streamRecord_event.clone(); streamRecord.setOldImage(null); Assertions.assertDoesNotThrow(() -> { <START> StreamRecord convertedStreamRecord = DynamodbStreamRecordTransformer.toStreamRecordV2(streamRecord); <END> }); }</code><technical_language>need store return - write as: java Assertions.assertDoesNotThrow(() -> { DynamodbStreamRecordTransformer.toStreamRecordV2(streamRecord); });</technical_language>

Target:
public void testToStreamRecordV2WhenOldImageIsNull() { com.amazonaws.services.lambda.runtime.events.models.dynamodb.StreamRecord streamRecord = streamRecord_event.clone(); streamRecord.setOldImage(null); Assertions.assertDoesNotThrow(() -> { DynamodbStreamRecordTransformer.toStreamRecordV2(streamRecord); }); }
Source:
<code>public int get(int i) { if (i < 0 || i >= index) { <START> throw new ArrayIndexOutOfBoundsException(i); <END> } return ints[i]; }</code><technical_language>size is missing in message</technical_language>

Target:
public int get(int i) { if (i < 0 || i >= index) { throw new ArrayIndexOutOfBoundsException("Index: " + i + ", Size: " + index); } return ints[i]; }
Source:
<code>public void save(TaskCreateDto dto) { Endpoint endpoint = endpointRepository.findOne(dto.getEndpointId()); if (endpoint == null) { throw new IllegalArgumentException("endpoint not valid"); } <START> Organization organization = null; <END> if (!dto.isPublic()) { organization = organizationRepository.findOne(dto.getOrganizationId()); } Task task = new Task(); task.setName(dto.getName()); task.setInstructions(dto.getInstructions()); task.setDescription(dto.getDescription()); task.setEndpoint(endpoint); task.setOrganization(organization); task = repository.save(task); endpoint.addTask(task); if (!dto.isPublic()) { organization.addTask(task); } }</code><technical_language>tasks relate a organization, set a public flag for this, if a non-coduno organizations owns tasks, able update etc, anymore if "unassign" public tasks organizations</technical_language>

Target:
public void save(TaskCreateDto dto) { Endpoint endpoint = endpointRepository.findOne(dto.getEndpointId()); if (endpoint == null) { throw new IllegalArgumentException("endpoint not valid"); } Organization organization= organizationRepository.findOne(dto.getOrganizationId()); if (organization == null) { throw new IllegalArgumentException("organization not valid"); } Task task = new Task(); task.setName(dto.getName()); task.setInstructions(dto.getInstructions()); task.setDescription(dto.getDescription()); task.setPublic(dto.isPublic()); endpoint.addTask(task); organization.addTask(task); repository.save(task); }
Source:
<code>private String getLogicalSlotString(SlotRequestId logicalSlotRequestId, ExecutionVertexID executionVertexId) { return String.format( <START> "logical %s for execution vertex (id %s) from the physical %s", <END> logicalSlotRequestId, executionVertexId, physicalSlotRequestId); }</code><technical_language>suggestion "logical slot %s for execution vertex (id %s) physical slot %s",</technical_language>

Target:
private String getLogicalSlotString(SlotRequestId logicalSlotRequestId, ExecutionVertexID executionVertexId) { return String.format( "logical slot (%s) for execution vertex (id %s) from the physical slot (%s)", logicalSlotRequestId, executionVertexId, physicalSlotRequestId); }
Source:
<code>private void buildIndex() { first = 0; index = new Entry[inQueue / 100 + 1]; Entry q = head; int qi = 0, ii = 0; <START> while (q != null) { <END> if (++qi % 100 == 0) index[ii++] = q; q = q.next; } last = ii - 1; }</code><technical_language>style nit: I phrase this loop as: int qi = 0, ii = 0; for (Entry q = head; q != null; q = q.next) { if (++qi % 100 == 0) index[ii++] = q; } shorter lines combine for loop. I "iterators" here, I sane for loop for Entry pointer is main loop control variable. other "iterators" qi ii related number of iterations loop need in for loop construct</technical_language>

Target:
private void buildIndex() { sinceLastIndex = 0; first = 0; index = new Entry[inQueue / 100 + 1]; int qi = 0, ii = 0; for (Entry q = head; q != null; q = q.next) { if (++qi % 100 == 0) index[ii++] = q; } last = ii - 1; }
Source:
<code>private int getAccessibility(int memberIndex) throws CoreException { <START> int targetAccessibilityBytes = memberIndex / 4; <END> int accessibilityBlockOffset = memberIndex % 4; int accessibilityMask = 3 << accessibilityBlockOffset * ACCESSIBILITY_BITS; long accessibilityOffset = record + MEMBER_ACCESSIBILITIES + targetAccessibilityBytes; int currentAccessibility = getDB().getByte(accessibilityOffset); int maskedAccessibility = currentAccessibility & accessibilityMask; maskedAccessibility >>>= accessibilityBlockOffset * ACCESSIBILITY_BITS; return maskedAccessibility; }</code><technical_language>Replace 4 VISIBILITY_VALUES_PER_BYTE</technical_language>

Target:
private int getAccessibility(int memberIndex) throws CoreException { int targetAccessibilityBytes = memberIndex / VISIBILITY_VALUES_PER_BYTE; int accessibilityBlockOffset = memberIndex % VISIBILITY_VALUES_PER_BYTE; int accessibilityMask = VISIBILITY_MASK << accessibilityBlockOffset * VISIBILITY_BITS; long accessibilityOffset = record + MEMBER_VISIBILITIES + targetAccessibilityBytes; int currentAccessibility = getDB().getByte(accessibilityOffset); int maskedAccessibility = currentAccessibility & accessibilityMask; maskedAccessibility >>>= accessibilityBlockOffset * VISIBILITY_BITS; return maskedAccessibility; }
Source:
<code>private URL getKVPurl(String baseUrl, TileIdentifier tileIdentifier) throws RuntimeException { if(!baseUrl.contains("?")) { baseUrl+="?"; } HashMap<String, Object> params = new HashMap<>(); params.put("service", "WMTS"); params.put("version", "1.0.0"); params.put("request", "getTile"); params.put("layer", service.getLayerName()); params.put("style", service.getStyleName()); params.put("format", service.getFormat()); params.put("tilematrixset", service.getTileMatrixSetName()); params.put("TileMatrix", service.getTileMatrix(tileIdentifier.getZ()).getIdentifier()); params.put("TileCol", tileIdentifier.getX()); params.put("TileRow", tileIdentifier.getY()); StringBuilder arguments = new StringBuilder(); for(String p:params.keySet()) { try { arguments.append(p).append("=").append(URLEncoder.encode(params.get(p).toString(),"UTF-8")); arguments.append('&'); <START> }catch (Exception e) { <END> } } try { return new URL(baseUrl+arguments.toString()); } catch (MalformedURLException e) { throw new RuntimeException(e); } }</code><technical_language>Exceptions swallowed. eye formatting ("}catch" -> "} catch"). new files, handy IDE mass format java coding conventions, spaces, 100 chars long lines)</technical_language>

Target:
private URL getKVPurl(String baseUrl, TileIdentifier tileIdentifier) throws RuntimeException { if (!baseUrl.contains("?")) { baseUrl += "?"; } HashMap<String, Object> params = new HashMap<>(); params.put("service", "WMTS"); params.put("version", "1.0.0"); params.put("request", "getTile"); params.put("layer", service.getLayerName()); params.put("style", service.getStyleName()); params.put("format", service.getFormat()); params.put("tilematrixset", service.getTileMatrixSetName()); params.put("TileMatrix", service.getTileMatrix(tileIdentifier.getZ()).getIdentifier()); params.put("TileCol", tileIdentifier.getX()); params.put("TileRow", tileIdentifier.getY()); StringBuilder arguments = new StringBuilder(); for (String key : params.keySet()) { Object val = params.get(key); try { if (val != null) { arguments.append(key).append("="); arguments.append(URLEncoder.encode(val.toString(), "UTF-8")); arguments.append('&'); } } catch (Exception e) { LOGGER.warning("Could not encode param '" + key + "' with value '" + val + "'"); } } try { return new URL(baseUrl + arguments.toString()); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
Source:
<code>public void createPublicIPAddress() { final PublicIPAddressApi ipApi = api.getPublicIPAddressApi(resourcegroup); final Map<String, String> tags = ImmutableMap.of("testkey", "testvalue"); PublicIPAddressProperties properties = <START> PublicIPAddressProperties.create(null, null, "Static", 4, null, null); <END> PublicIPAddress ip = ipApi.createOrUpdate(publicIpAddressName, LOCATION, tags, properties); assertNotNull(ip); assertEquals(ip.name(), publicIpAddressName); assertEquals(ip.location(), LOCATION); assertEquals(ip.id(), String.format("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPAddresses/%s", subscriptionid, resourcegroup, publicIpAddressName)); assertEquals(ip.tags().get("testkey"), "testvalue"); assertNotNull(ip.properties()); assertEquals(ip.properties().provisioningState(), "Updating"); assertNull(ip.properties().ipAddress()); assertEquals(ip.properties().publicIPAllocationMethod(), "Static"); assertEquals(ip.properties().idleTimeoutInMinutes().intValue(), 4); }</code><technical_language>Another good candidate builders</technical_language>

Target:
public void createPublicIPAddress() { final PublicIPAddressApi ipApi = api.getPublicIPAddressApi(resourcegroup); final Map<String, String> tags = ImmutableMap.of("testkey", "testvalue"); PublicIPAddressProperties properties = PublicIPAddressProperties.builder() .publicIPAllocationMethod("Static") .idleTimeoutInMinutes(4) .build(); PublicIPAddress ip = ipApi.createOrUpdate(publicIpAddressName, LOCATION, tags, properties); assertNotNull(ip); assertEquals(ip.name(), publicIpAddressName); assertEquals(ip.location(), LOCATION); assertEquals(ip.id(), String.format("/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPAddresses/%s", subscriptionid, resourcegroup, publicIpAddressName)); assertEquals(ip.tags().get("testkey"), "testvalue"); assertNotNull(ip.properties()); assertEquals(ip.properties().provisioningState(), "Updating"); assertNull(ip.properties().ipAddress()); assertEquals(ip.properties().publicIPAllocationMethod(), "Static"); assertEquals(ip.properties().idleTimeoutInMinutes().intValue(), 4); }
Source:
<code>public void testBlockingOnStoreAvailabilityChange() { Cache<Object, Object> cache = createManagerAndGetCache(false, 1); AdvancedAsyncCacheWriter asyncWriter = TestingUtil.getFirstWriter(cache); DummyInMemoryStore store = (DummyInMemoryStore) TestingUtil.extractField(AdvancedAsyncCacheWriter.class, asyncWriter, "actual"); store.setAvailable(true); cache.put(1, 1); MarshalledEntry storedEntry = null; for (int i = 0; i < 100 && (storedEntry = store.load(1)) == null; i++) { <START> TestingUtil.sleepThread(100); <END> } assertNotNull(storedEntry); assertEquals(1, store.size()); PersistenceManager pm = TestingUtil.extractComponent(cache, PersistenceManager.class); store.setAvailable(false); assertFalse(store.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertTrue(asyncWriter.isAvailable()); assertFalse(TestingUtil.extractField(asyncWriter, "delegateAvailable")); assertTrue(pm.isAvailable()); cache.putAll(intMap(0, 10)); assertEquals(1, store.size()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertFalse(asyncWriter.isAvailable()); assertFalse(pm.isAvailable()); Exceptions.expectException(StoreUnavailableException.class, () -> cache.putAll(intMap(10, 20))); assertEquals(1, store.size()); store.setAvailable(true); assertTrue(store.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertTrue(asyncWriter.isAvailable()); assertTrue(pm.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertEquals(10, store.size()); assertFalse(store.contains(10)); }</code><technical_language>this eventually(() -> store.load(1) != null)</technical_language>

Target:
public void testBlockingOnStoreAvailabilityChange() { Cache<Object, Object> cache = createManagerAndGetCache(false, 1); AdvancedAsyncCacheWriter asyncWriter = TestingUtil.getFirstWriter(cache); DummyInMemoryStore store = (DummyInMemoryStore) TestingUtil.extractField(AdvancedAsyncCacheWriter.class, asyncWriter, "actual"); store.setAvailable(true); cache.put(1, 1); eventually(() -> store.load(1) != null); assertEquals(1, store.size()); PersistenceManager pm = TestingUtil.extractComponent(cache, PersistenceManager.class); store.setAvailable(false); assertFalse(store.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertTrue(asyncWriter.isAvailable()); assertFalse(TestingUtil.extractField(asyncWriter, "delegateAvailable")); assertTrue(pm.isAvailable()); cache.putAll(intMap(0, 10)); assertEquals(1, store.size()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertFalse(asyncWriter.isAvailable()); assertFalse(pm.isAvailable()); Exceptions.expectException(StoreUnavailableException.class, () -> cache.putAll(intMap(10, 20))); assertEquals(1, store.size()); store.setAvailable(true); assertTrue(store.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertTrue(asyncWriter.isAvailable()); assertTrue(pm.isAvailable()); TestingUtil.sleepThread(AVAILABILITY_INTERVAL * 5); assertEquals(10, store.size()); assertFalse(store.contains(10)); }
Source:
<code>public void testGetFileNameWithRewriting() throws Exception { JsonParser parser = new JsonParser(); try { <START> JsonElement tree = parser.parse( <END> new java.io.FileReader( FileUtils.toFile( CLASS.getResource("prettified_filenames_metadata.json") ) ) ); JsonArray tests = tree.getAsJsonArray(); for( JsonElement test: tests ) { JsonObject o = test.getAsJsonObject(); String original = o.get("filename").getAsString(); String prettified = o.get("prettified").getAsString(); assertThat(FileUtil.getFileNamePrettified(original)).isEqualTo(prettified); } } catch( Exception ex ) { throw( ex ); } }</code><technical_language>Please indent try</technical_language>

Target:
public void testGetFileNameWithRewriting() throws Exception { JsonParser parser = new JsonParser(); try { JsonElement tree = parser.parse( new java.io.FileReader( FileUtils.toFile( CLASS.getResource("prettified_filenames_metadata.json") ) ) ); JsonArray tests = tree.getAsJsonArray(); for( JsonElement test: tests ) { JsonObject o = test.getAsJsonObject(); String original = o.get("filename").getAsString(); String prettified = o.get("prettified").getAsString(); assertThat(FileUtil.getFileNamePrettified(original)).isEqualTo(prettified); } } catch( Exception ex ) { throw(new AssertionError(ex)); } }
Source:
<code>public void freshTimestampsDelegatesToTimestampService() { int numTimestamps = 10; TimestampRange range = TimestampRange.createInclusiveRange(21L, 30L); <START> when(timestampService.getFreshTimestamps(10)).thenReturn(range); <END> assertEquals(range, timelock.getFreshTimestamps(numTimestamps)); }</code><technical_language>getFreshTimestamps(numTimestamps)</technical_language>

Target:
public void freshTimestampsDelegatesToTimestampService() { int numTimestamps = 10; TimestampRange range = TimestampRange.createInclusiveRange(21L, 30L); when(timestampService.getFreshTimestamps(numTimestamps)).thenReturn(range); assertEquals(range, timelock.getFreshTimestamps(numTimestamps)); }
Source:
<code>public DirectDebitPayment create(Account account, CreateDirectDebitPaymentRequest directDebitPaymentRequest) { var directDebitConnectorCreatePaymentRequest = aDirectDebitConnectorCreatePaymentRequest() <START> .withAgreementId(directDebitPaymentRequest.getAgreementId()) <END> .withAmount(directDebitPaymentRequest.getAmount()) .withDescription(directDebitPaymentRequest.getDescription()) .withReference(directDebitPaymentRequest.getReference()) .build(); Response response = client .target(directDebitConnectorUriGenerator.chargesURI(account)) .request() .accept(MediaType.APPLICATION_JSON) .post(Entity.entity(directDebitConnectorCreatePaymentRequest, MediaType.APPLICATION_JSON_TYPE)); if (response.getStatus() != HttpStatus.SC_CREATED) { throw new CreateChargeException(response); } var connectorResponse = response .readEntity(DirectDebitConnectorCreatePaymentResponse.class); return aDirectDebitPayment().withAmount(connectorResponse.getAmount()) .withReference(connectorResponse.getReference()) .withDescription(connectorResponse.getDescription()) .withPaymentId(connectorResponse.getPaymentExternalId()) .withPaymentProvider(connectorResponse.getPaymentProvider()) .withState(connectorResponse.getState()) .withCreatedDate(connectorResponse.getCreatedDate()) .withSelfLink(publicApiUriGenerator.getDirectDebitPaymentURI(connectorResponse.getPaymentExternalId())) .withEventsLink(publicApiUriGenerator.getDirectDebitPaymentEventsURI(connectorResponse.getPaymentExternalId())) .build(); }</code><technical_language>this renamed withMandateId</technical_language>

Target:
public DirectDebitPayment create(Account account, CreateDirectDebitPaymentRequest directDebitPaymentRequest) { var directDebitConnectorCreatePaymentRequest = aDirectDebitConnectorCreatePaymentRequest() .withMandateId(directDebitPaymentRequest.getMandateId()) .withAmount(directDebitPaymentRequest.getAmount()) .withDescription(directDebitPaymentRequest.getDescription()) .withReference(directDebitPaymentRequest.getReference()) .build(); Response response = client .target(directDebitConnectorUriGenerator.chargesURI(account)) .request() .accept(MediaType.APPLICATION_JSON) .post(Entity.entity(directDebitConnectorCreatePaymentRequest, MediaType.APPLICATION_JSON_TYPE)); if (response.getStatus() != HttpStatus.SC_CREATED) { throw new CreateChargeException(response); } var connectorResponse = response .readEntity(DirectDebitConnectorCreatePaymentResponse.class); return aDirectDebitPayment().withAmount(connectorResponse.getAmount()) .withReference(connectorResponse.getReference()) .withDescription(connectorResponse.getDescription()) .withPaymentId(connectorResponse.getPaymentExternalId()) .withPaymentProvider(connectorResponse.getPaymentProvider()) .withState(connectorResponse.getState()) .withCreatedDate(connectorResponse.getCreatedDate()) .withSelfLink(publicApiUriGenerator.getDirectDebitPaymentURI(connectorResponse.getPaymentExternalId())) .withEventsLink(publicApiUriGenerator.getDirectDebitPaymentEventsURI(connectorResponse.getPaymentExternalId())) .build(); }
Source:
<code>public void undeploy(String name) { Assert.hasText(name, "name cannot be blank or null"); <START> validateBeforeUndeploy(name); <END> logger.trace("Undeploying {}", name); D definition = getDefinitionRepository().findOne(name); if (definition == null) { throwNoSuchDefinitionException(name); } final I instance = instanceRepository.findOne(name); if (instance == null) { throwNotDeployedException(name); } instanceRepository.delete(instance); undeployResource(name); }</code><technical_language>here, validateBeforeUndeploy is exact code below</technical_language>

Target:
public void undeploy(String name) { validateBeforeUndeploy(name); logger.trace("Undeploying {}", name); instanceRepository.delete(instanceRepository.findOne(name)); undeployResource(name); }
Source:
<code>public int compareTo(TimeAndDims rhs) { int retVal = Longs.compare(timestamp, rhs.timestamp); if (retVal == 0) { retVal = Ints.compare(dims.length, rhs.dims.length); } int index = 0; while (retVal == 0 && index < dims.length) { String[] lhsVals = dims[index]; String[] rhsVals = rhs.dims[index]; if (lhsVals == null) { if (rhsVals == null) { ++index; continue; } return -1; } if (rhsVals == null) { return 1; } retVal = Ints.compare(lhsVals.length, rhsVals.length); int valsIndex = 0; while (retVal == 0 && valsIndex < lhsVals.length) { final String lhsVal = lhsVals[valsIndex]; final String rhsVal = rhsVals[valsIndex]; <START> if(lhsVal == null && rhsVal == null) return 0; <END> else if(lhsVal == null) return -1; else if(rhsVal == null) return 1; else retVal = lhsVal.compareTo(rhsVal); ++valsIndex; } ++index; } return retVal; }</code><technical_language>fix formatting here</technical_language>

Target:
public int compareTo(TimeAndDims rhs) { int retVal = Longs.compare(timestamp, rhs.timestamp); if (retVal == 0) { retVal = Ints.compare(dims.length, rhs.dims.length); } int index = 0; while (retVal == 0 && index < dims.length) { String[] lhsVals = dims[index]; String[] rhsVals = rhs.dims[index]; if (lhsVals == null) { if (rhsVals == null) { ++index; continue; } return -1; } if (rhsVals == null) { return 1; } retVal = Ints.compare(lhsVals.length, rhsVals.length); int valsIndex = 0; while (retVal == 0 && valsIndex < lhsVals.length) { final String lhsVal = lhsVals[valsIndex]; final String rhsVal = rhsVals[valsIndex]; if (lhsVal == null && rhsVal == null) { return 0; } else if (lhsVal == null) { return -1; } else if (rhsVal == null) { return 1; } else { retVal = lhsVal.compareTo(rhsVal); } ++valsIndex; } ++index; } return retVal; }
Source:
<code>public List<URI> uploadAllFromHome(String inVerzeichnis) { User currentUser = Helper.getCurrentUser(); ArrayList<URI> files = new ArrayList<>(); FilenameFilter filter = new FileNameEndsWithFilter("]"); try { if (currentUser != null) { URI directoryName = serviceManager.getUserService().getHomeDirectory(currentUser).resolve(inVerzeichnis); files = fileService.getSubUris(filter, directoryName); } else { <START> Helper.setFehlerMeldung("uploadFromHomeAlle abgebrochen, Fehler - no user assigned"); <END> return files; } } catch (IOException ioe) { logger.error("Exception uploadFromHomeAlle()", ioe); Helper.setFehlerMeldung("uploadFromHomeAlle abgebrochen, Fehler", ioe.getMessage()); return files; } for (URI data : files) { String dataString = data.toString(); if (dataString.endsWith("/") || dataString.endsWith("\\")) { data = URI.create(dataString.substring(0, dataString.length() - 1)); } if (data.toString().contains("/")) { data = URI.create(dataString.substring(dataString.lastIndexOf("/"))); } } return files; }</code><technical_language>Please, do mix German English. Please language a translation key for translatable error messages</technical_language>

Target:
public List<URI> uploadAllFromHome(String inVerzeichnis) { User currentUser = Helper.getCurrentUser(); ArrayList<URI> files = new ArrayList<>(); FilenameFilter filter = new FileNameEndsWithFilter("]"); try { if (currentUser != null) { URI directoryName = serviceManager.getUserService().getHomeDirectory(currentUser).resolve(inVerzeichnis); files = fileService.getSubUris(filter, directoryName); } else { Helper.setFehlerMeldung("uploadFromHomeAlle abgebrochen, Fehler", Helper.getTranslation("noUser")); return files; } } catch (IOException ioe) { logger.error("Exception uploadFromHomeAlle()", ioe); Helper.setFehlerMeldung("uploadFromHomeAlle abgebrochen, Fehler", ioe.getMessage()); return files; } for (URI data : files) { String dataString = data.toString(); if (dataString.endsWith("/") || dataString.endsWith("\\")) { data = URI.create(dataString.substring(0, dataString.length() - 1)); } if (data.toString().contains("/")) { data = URI.create(dataString.substring(dataString.lastIndexOf("/"))); } } return files; }
Source:
<code>private List<AccountInfo> suggestAccount(VisibilityControl visibilityControl) throws OrmException { if (!suggestAccounts) { return Collections.emptyList(); } final String a = query; final String b = a + MAX_SUFFIX; final LinkedHashMap<Account.Id, AccountInfo> r = <START> new LinkedHashMap<Account.Id, AccountInfo>(); <END> for (final Account p : dbProvider.get().accounts() .suggestByFullName(a, b, limit)) { addSuggestion(r, p, new AccountInfo(p.getId()), visibilityControl); } if (r.size() < limit) { for (final Account p : dbProvider.get().accounts() .suggestByPreferredEmail(a, b, limit - r.size())) { addSuggestion(r, p, new AccountInfo(p.getId()), visibilityControl); } } if (r.size() < limit) { for (final AccountExternalId e : dbProvider.get().accountExternalIds() .suggestByEmailAddress(a, b, limit - r.size())) { if (!r.containsKey(e.getAccountId())) { final Account p = accountCache.get(e.getAccountId()).getAccount(); final AccountInfo info = new AccountInfo(p.getId()); addSuggestion(r, p, info, visibilityControl); } } } return new ArrayList<AccountInfo>(r.values()); }</code><technical_language>Maps.newLinkedHashMap()</technical_language>

Target:
private List<AccountInfo> suggestAccount(VisibilityControl visibilityControl) throws OrmException { if (!suggestAccounts) { return Collections.emptyList(); } final String a = query; final String b = a + MAX_SUFFIX; final LinkedHashMap<Account.Id, AccountInfo> r = Maps.newLinkedHashMap(); for (final Account p : dbProvider.get().accounts() .suggestByFullName(a, b, limit)) { addSuggestion(r, p, new AccountInfo(p.getId()), visibilityControl); } if (r.size() < limit) { for (final Account p : dbProvider.get().accounts() .suggestByPreferredEmail(a, b, limit - r.size())) { addSuggestion(r, p, new AccountInfo(p.getId()), visibilityControl); } } if (r.size() < limit) { for (final AccountExternalId e : dbProvider.get().accountExternalIds() .suggestByEmailAddress(a, b, limit - r.size())) { if (!r.containsKey(e.getAccountId())) { final Account p = accountCache.get(e.getAccountId()).getAccount(); final AccountInfo info = new AccountInfo(p.getId()); addSuggestion(r, p, info, visibilityControl); } } } return new ArrayList<AccountInfo>(r.values()); }
Source:
<code><START> public void setText(String input, WebElement element) { <END> element.click(); element.clear(); element.sendKeys(input); element.sendKeys(Keys.ESCAPE); }</code><technical_language>This methods protected public accessed subclasses</technical_language>

Target:
protected void setText(String input, WebElement element) { element.click(); element.clear(); element.sendKeys(input); element.sendKeys(Keys.ESCAPE); }
Source:
<code>public static Collection<Descriptor> getSortedDescriptorsForGlobalConfigNoSecurity() { <START> return getSortedDescriptorsForGlobalConfigUnclassified(); <END> }</code><technical_language>I this is wrong (there's tool configurations). retain existing behavior adapt Predicate needed</technical_language>

Target:
public static Collection<Descriptor> getSortedDescriptorsForGlobalConfigNoSecurity() { return getSortedDescriptorsForGlobalConfigByDescriptor(d -> GlobalSecurityConfiguration.FILTER.negate().test(d)); }
Source:
<code>private long getLocalAvailableSpace() { <START> Path path = Paths.get(outputDir.getAbsolutePath()); <END> FileStore fs = java.nio.file.Files.getFileStore(path); return fs.getUsableSpace(); }</code><technical_language>val</technical_language>

Target:
private long getLocalAvailableSpace() { val path = Paths.get(outputDir.getAbsolutePath()); val fs = java.nio.file.Files.getFileStore(path); return fs.getUsableSpace(); }
Source:
<code>@Override protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int seq) { String str = super.getParameterName(op, param, seq); try { Method m = getMethod(op); MXBeanParametersNames namesAnn = m.getAnnotation(MXBeanParametersNames.class); if (namesAnn != null) { assert namesAnn.value() != null; assert seq < namesAnn.value().length; str = namesAnn.value()[seq]; assert str != null; assert !str.trim().isEmpty(); <START> } else { <END> MXBeanParameterInfo argumentInfoAnnotation = getMXBeanArgumentAnnotation(m, seq); if (argumentInfoAnnotation != null) { str = argumentInfoAnnotation.name(); assert str != null; assert !str.trim().isEmpty(); } } } catch (SecurityException | ClassNotFoundException ignored) { } return str; }</code><technical_language>else keyword next line code style</technical_language>

Target:
@Override protected String getParameterName(MBeanOperationInfo op, MBeanParameterInfo param, int seq) { String str = super.getParameterName(op, param, seq); try { Method m = getMethod(op); MXBeanParametersNames namesAnn = m.getAnnotation(MXBeanParametersNames.class); if (namesAnn != null) { assert namesAnn.value() != null; assert seq < namesAnn.value().length; str = namesAnn.value()[seq]; assert str != null : NAME_MUST_BE_NOT_NULL + str; assert !str.trim().isEmpty() : NAME_MUST_BE_NOT_EMPTY + str; } else { MXBeanParameter argInfoAnnotation = getMXBeanArgumentAnnotation(m, seq); if (argInfoAnnotation != null) { str = argInfoAnnotation.name(); assert str != null : NAME_MUST_BE_NOT_NULL + str; assert !str.trim().isEmpty() : NAME_MUST_BE_NOT_EMPTY + str; } } } catch (SecurityException | ClassNotFoundException ignored) { } return str; }
Source:
<code>public void setPatientProgram(PatientProgram patientProgram) { <START> setOwner(new PatientProgram(patientProgram)); <END> }</code><technical_language>This set patientProgram creating another instance</technical_language>

Target:
public void setPatientProgram(PatientProgram patientProgram) { setOwner(patientProgram); }
Source:
<code>public String getEmitDateStr() { <START> SimpleDateFormat sdf = new SimpleDateFormat(this.DATE_FORMAT, Locale.ITALY); <END> sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(this.getEmitDate()!=null ? this.getEmitDate(): new Date()); }</code><technical_language>this format Locale.ITALY is used? Locale.ROOT more locale-agnostic? Is some fixed date format in TSD RFC822/2822/5322 one</technical_language>

Target:
public String getEmitDateStr() { SimpleDateFormat sdf = new SimpleDateFormat(this.DATE_FORMAT, Locale.ROOT); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(this.getEmitDate()!=null ? this.getEmitDate(): new Date()); }
Source:
<code>public void purge(Executor threadPool, final PurgeListener task) { ExecutorAllCompletionService eacs = new ExecutorAllCompletionService(threadPool); Future<Void> future = eacs.submit(() -> { long now = timeService.wallClockTime(); List<KeyValuePair<Object, FileEntry>> entriesToPurge = new ArrayList<KeyValuePair<Object, FileEntry>>(); synchronized (entries) { for (Iterator<Map.Entry<K, FileEntry>> it = entries.entrySet().iterator(); it.hasNext(); ) { Map.Entry<K, FileEntry> next = it.next(); FileEntry fe = next.getValue(); if (fe.isExpired(now)) { it.remove(); entriesToPurge.add(new KeyValuePair<Object, FileEntry>(next.getKey(), fe)); } } } resizeLock.readLock().lock(); try { for (Iterator<KeyValuePair<Object, FileEntry>> it = entriesToPurge.iterator(); it.hasNext(); ) { KeyValuePair<Object, FileEntry> next = it.next(); FileEntry fe = next.getValue(); if (fe.isExpired(now)) { it.remove(); try { free(fe); } catch (Exception e) { throw new PersistenceException(e); } <START> if (task != null) task.entryPurged(next.getKey()); <END> } } synchronized (freeList) { processFreeEntries(); } } finally { resizeLock.readLock().unlock(); } return null; }); try { future.get(); } catch (InterruptedException e) { throw new PersistenceException(e); } catch (ExecutionException e) { throw new PersistenceException(e.getCause()); } }</code><technical_language>run PurgeListener Executor</technical_language>

Target:
public void purge(Executor threadPool, final PurgeListener task) { long now = timeService.wallClockTime(); List<KeyValuePair<Object, FileEntry>> entriesToPurge = new ArrayList<KeyValuePair<Object, FileEntry>>(); synchronized (entries) { for (Iterator<Map.Entry<K, FileEntry>> it = entries.entrySet().iterator(); it.hasNext(); ) { Map.Entry<K, FileEntry> next = it.next(); FileEntry fe = next.getValue(); if (fe.isExpired(now)) { it.remove(); entriesToPurge.add(new KeyValuePair<Object, FileEntry>(next.getKey(), fe)); } } } resizeLock.readLock().lock(); try { for (Iterator<KeyValuePair<Object, FileEntry>> it = entriesToPurge.iterator(); it.hasNext(); ) { KeyValuePair<Object, FileEntry> next = it.next(); FileEntry fe = next.getValue(); if (fe.isExpired(now)) { it.remove(); try { free(fe); } catch (Exception e) { throw new PersistenceException(e); } if (task != null) task.entryPurged(next.getKey()); } } synchronized (freeList) { processFreeEntries(); } } finally { resizeLock.readLock().unlock(); } }
Source:
<code>private void commitTransaction() { if (!unitOfWork.transactional()) { return; } final Transaction txn = session.getTransaction(); <START> if (txn != null && (txn.getStatus() == ACTIVE || txn.getStatus() == MARKED_ROLLBACK)) { <END> txn.commit(); } }</code><technical_language>[TransactionStatus#canRollback()](<LINK_0> here</technical_language>

Target:
private void commitTransaction() { if (!unitOfWork.transactional()) { return; } final Transaction txn = session.getTransaction(); if (txn != null && txn.getStatus().canRollback()) { txn.commit(); } }
Source:
<code>public IDifferenceGroupProvider createGroupProvider() { Object instance; try { instance = element .createExecutableExtension(DifferenceGroupProviderExtensionRegistryListener.ATT_CLASS); if (instance instanceof IDifferenceGroupProvider) { IDifferenceGroupProvider groupProvider = (IDifferenceGroupProvider)instance; return groupProvider; } } catch (CoreException e) { <START> Throwables.propagate(e); <END> } return null; }</code><technical_language>is responsibility of callers deal exceptions hidden them. Do propagate this, log fall out of catch return null, properly throw CoreException caller error case, in code simply log recuperate (use other groups, default if of extensions failed instantiated)</technical_language>

Target:
public IDifferenceGroupProvider createGroupProvider() { Object instance; try { instance = element .createExecutableExtension(DifferenceGroupProviderExtensionRegistryListener.ATT_CLASS); if (instance instanceof IDifferenceGroupProvider) { IDifferenceGroupProvider groupProvider = (IDifferenceGroupProvider)instance; return groupProvider; } } catch (CoreException e) { EMFCompareRCPUIPlugin.getDefault().log(e); } return null; }
Source:
<code>public int tick() { long timeStart = System.currentTimeMillis(); final int sizeCap = 500; int numCubes = 0; for (int i = 0; i < this.activeStages; ++i) { numCubes += Math.min(sizeCap, this.stages.get(i).getProcessor().processor.getNumInQueue()); } for (int i = 0; i < this.activeStages; ++i) { if (numCubes <= 0) { this.stages.get(i).getProcessor().share = 0; } else { int size = Math.min(sizeCap, this.stages.get(i).getProcessor().processor.getNumInQueue()); this.stages.get(i).getProcessor().share = (float) size/(float) numCubes; } } int numProcessed = 0; <START> for (int i = 0; i < this.activeStages; ++i) { <END> StageProcessor processor = this.stages.get(i).getProcessor(); if (processor.share <= 0) { continue; } int numMsToProcess = (int) (Math.ceil(processor.share*TickBudget)); long stageTimeStart = System.currentTimeMillis(); int numStageProcessed = processor.processor.processQueueUntil(stageTimeStart + numMsToProcess); numProcessed += numStageProcessed; advanceCubes(processor.processor, i); } long timeDiff = System.currentTimeMillis() - timeStart; if (numProcessed > 0) { CubicChunks.LOGGER.debug("Processed cubes in ms.", numProcessed, timeDiff); for (int i = 0; i < this.activeStages; ++i) { CubicChunks.LOGGER.debug(this.stages.get(i).getProcessor().processor.getProcessingReport()); } } return numProcessed; }</code><technical_language>This change (stage-->i) is completely pointless, code readable</technical_language>

Target:
public int tick() { long timeStart = System.currentTimeMillis(); final int sizeCap = 500; int numCubes = 0; for (GeneratorStage stage : this.stages) { numCubes += Math.min(sizeCap, stage.getProcessor().processor.getNumInQueue()); } for (GeneratorStage stage : this.stages) { if (numCubes <= 0) { stage.getProcessor().share = 0; } else { int size = Math.min(sizeCap, stage.getProcessor().processor.getNumInQueue()); stage.getProcessor().share = (float) size/(float) numCubes; } } int numProcessed = 0; for (GeneratorStage stage : this.stages) { StageProcessor processor = stage.getProcessor(); if (processor.share <= 0) { continue; } int numMsToProcess = (int) (Math.ceil(processor.share*TickBudget)); long stageTimeStart = System.currentTimeMillis(); int numStageProcessed = processor.processor.processQueueUntil(stageTimeStart + numMsToProcess); numProcessed += numStageProcessed; advanceCubes(processor.processor, stage); } long timeDiff = System.currentTimeMillis() - timeStart; if (numProcessed > 0) { CubicChunks.LOGGER.debug("Processed cubes in ms.", numProcessed, timeDiff); for (GeneratorStage stage : this.stages) { CubicChunks.LOGGER.debug(stage.getProcessor().processor.getProcessingReport()); } } return numProcessed; }
Source:
<code>public boolean isConverged(int iteration, LongValue value) { if ( value.getValue() > 3 ) { return true; } <START> else <END> return false; }</code><technical_language>checkstyle complain here, missing {}</technical_language>

Target:
public boolean isConverged(int iteration, LongValue value) { return value.getValue() > 3; }
Source:
<code>public void afterSuite() throws IOException { <START> System.out.println("afterSuite " + getClass().getName()); <END> _lock.close(); super.afterSuite(); }</code><technical_language>here, usage of this output</technical_language>

Target:
public void afterSuite() throws IOException { _lock.close(); super.afterSuite(); }
Source:
<code><START> public MicroGauge(Gauge gauge) { <END> this.gauge = gauge; }</code><technical_language>This public remove. Travis report</technical_language>

Target:
MicroGauge(Gauge gauge) { this.gauge = gauge; }
Source:
<code>void createV1ForwardIndexForTextIndex(String column, IndexLoadingConfig indexLoadingConfig) throws IOException { FieldSpec fieldSpec = _schema.getFieldSpecFor(column); Preconditions.checkNotNull(fieldSpec); checkUnsupportedOperationsForTextIndex(column, indexLoadingConfig, fieldSpec); int totalDocs = _segmentMetadata.getTotalDocs(); Object defaultValue = fieldSpec.getDefaultNullValue(); String stringDefaultValue = (String) defaultValue; <START> int lengthOfLongestEntry = stringDefaultValue.getBytes(Charset.forName("UTF-8")).length; <END> int dictionaryElementSize = 0; SingleValueVarByteRawIndexCreator rawIndexCreator = new SingleValueVarByteRawIndexCreator(_indexDir, ChunkCompressorFactory.CompressionType.SNAPPY, column, totalDocs, lengthOfLongestEntry); for (int docId = 0; docId < totalDocs; docId++) { rawIndexCreator.index(docId, defaultValue); } rawIndexCreator.close(); Object sortedArray = new String[]{(String) defaultValue}; DefaultColumnStatistics columnStatistics = new DefaultColumnStatistics(defaultValue , defaultValue , sortedArray, false, totalDocs, 0); ColumnIndexCreationInfo columnIndexCreationInfo = new ColumnIndexCreationInfo(columnStatistics, false , false, null, null, true , defaultValue ); SegmentColumnarIndexCreator .addColumnMetadataInfo(_segmentProperties, column, columnIndexCreationInfo, totalDocs, fieldSpec, false , dictionaryElementSize, false , TextIndexType.NONE); }</code><technical_language>Good catch suggestion int lengthOfLongestEntry = StringUtil.encodeUtf8(stringDefaultValue).length;</technical_language>

Target:
void createV1ForwardIndexForTextIndex(String column, IndexLoadingConfig indexLoadingConfig) throws IOException { FieldSpec fieldSpec = _schema.getFieldSpecFor(column); Preconditions.checkNotNull(fieldSpec); checkUnsupportedOperationsForTextIndex(column, indexLoadingConfig, fieldSpec); int totalDocs = _segmentMetadata.getTotalDocs(); Object defaultValue = fieldSpec.getDefaultNullValue(); String stringDefaultValue = (String) defaultValue; int lengthOfLongestEntry = StringUtil.encodeUtf8(stringDefaultValue).length; int dictionaryElementSize = 0; SingleValueVarByteRawIndexCreator rawIndexCreator = new SingleValueVarByteRawIndexCreator(_indexDir, ChunkCompressorFactory.CompressionType.SNAPPY, column, totalDocs, lengthOfLongestEntry); for (int docId = 0; docId < totalDocs; docId++) { rawIndexCreator.index(docId, defaultValue); } rawIndexCreator.close(); Object sortedArray = new String[]{(String) defaultValue}; DefaultColumnStatistics columnStatistics = new DefaultColumnStatistics(defaultValue , defaultValue , sortedArray, false, totalDocs, 0); ColumnIndexCreationInfo columnIndexCreationInfo = new ColumnIndexCreationInfo(columnStatistics, false , false, null, null, true , defaultValue ); SegmentColumnarIndexCreator .addColumnMetadataInfo(_segmentProperties, column, columnIndexCreationInfo, totalDocs, fieldSpec, false , dictionaryElementSize, false , TextIndexType.NONE); }
Source:
<code>public CurrencyValuesArray convertedTo(Currency reportingCurrency, CalculationMarketData marketData) { if (currency.equals(reportingCurrency)) { return this; } MarketDataBox<FxRate> rates = marketData.getValue(FxRateKey.of(currency, reportingCurrency)); checkNumberOfRates(rates.getScenarioCount()); double[] convertedValues = IntStream.range(0, values.size()) <START> .mapToDouble(i -> rates.getValue(i).convert(values.get(i), currency, reportingCurrency)) <END> .toArray(); return new CurrencyValuesArray(reportingCurrency, DoubleArray.ofUnsafe(convertedValues)); }</code><technical_language>values.mapWithIndex() here, avoids unsafe</technical_language>

Target:
public CurrencyValuesArray convertedTo(Currency reportingCurrency, CalculationMarketData marketData) { if (currency.equals(reportingCurrency)) { return this; } MarketDataBox<FxRate> rates = marketData.getValue(FxRateKey.of(currency, reportingCurrency)); checkNumberOfRates(rates.getScenarioCount()); DoubleArray convertedValues = values.mapWithIndex((i, v) -> rates.getValue(i).convert(v, currency, reportingCurrency)); return new CurrencyValuesArray(reportingCurrency, convertedValues); }
Source:
<code>public BigtableConnection call() throws Exception { final CredentialOptions credentials = this.credentials.build(); final RetryOptions retryOptions = new RetryOptions.Builder() .addStatusToRetryOn(Status.Code.UNKNOWN) .setAllowRetriesWithoutTimestamp(true) .build(); final BulkOptions bulkOptions; <START> bulkOptions = batchSize <END> .map(integer -> new BulkOptions.Builder().setBulkMaxRowKeyCount(integer).build()) .orElseGet(() -> new BulkOptions.Builder().build()); final BigtableOptions options = new BigtableOptions.Builder() .setProjectId(project) .setInstanceId(instance) .setUserAgent(USER_AGENT) .setDataChannelCount(64) .setCredentialOptions(credentials) .setRetryOptions(retryOptions) .setBulkOptions(bulkOptions) .build(); final BigtableSession session = new BigtableSession(options, executorService); final BigtableTableAdminClient adminClient = new BigtableTableTableAdminClientImpl(async, session.getTableAdminClient(), project, instance); final BigtableMutator mutator = new BigtableMutatorImpl(async, session, disableBulkMutations, flushIntervalSeconds); final BigtableDataClient client = new BigtableDataClientImpl(async, session, mutator, project, instance); return new GrpcBigtableConnection( async, project, instance, session, mutator, adminClient, client); }</code><technical_language>need for a separate declaration</technical_language>

Target:
public BigtableConnection call() throws Exception { final CredentialOptions credentials = this.credentials.build(); final RetryOptions retryOptions = new RetryOptions.Builder() .addStatusToRetryOn(Status.Code.UNKNOWN) .setAllowRetriesWithoutTimestamp(true) .build(); final BulkOptions bulkOptions = batchSize .map(integer -> new BulkOptions.Builder().setBulkMaxRowKeyCount(integer).build()) .orElseGet(() -> new BulkOptions.Builder().build()); final BigtableOptions options = new BigtableOptions.Builder() .setProjectId(project) .setInstanceId(instance) .setUserAgent(USER_AGENT) .setDataChannelCount(64) .setCredentialOptions(credentials) .setRetryOptions(retryOptions) .setBulkOptions(bulkOptions) .build(); final BigtableSession session = new BigtableSession(options, executorService); final BigtableTableAdminClient adminClient = new BigtableTableTableAdminClientImpl(async, session.getTableAdminClient(), project, instance); final BigtableMutator mutator = new BigtableMutatorImpl(async, session, disableBulkMutations, flushIntervalSeconds); final BigtableDataClient client = new BigtableDataClientImpl(async, session, mutator, project, instance); return new GrpcBigtableConnection( async, project, instance, session, mutator, adminClient, client); }
Source:
<code>public PieChartViewerStateContentSelected(final TmfPieChartViewer context) { if (context.isDisposed()) { return; } Display.getDefault().asyncExec(new Runnable() { @Override public void run() { <START> synchronized (context.getMutexLayoutChange()) { <END> if (!context.isDisposed()) { context.updateGlobalPieChart(); context.updateTimeRangeSelectionPieChart(); context.getTimeRangePC().redraw(); context.getGlobalPC().getLegend().setPosition(SWT.BOTTOM); context.layout(); } } } }); }</code><technical_language>context sync obj</technical_language>

Target:
public PieChartViewerStateContentSelected(final TmfPieChartViewer context) { if (context.isDisposed()) { return; } Display.getDefault().asyncExec(new Runnable() { @Override public void run() { synchronized (context) { if (!context.isDisposed()) { context.updateGlobalPieChart(); context.updateTimeRangeSelectionPieChart(); context.getTimeRangePC().redraw(); context.getGlobalPC().getLegend().setPosition(SWT.BOTTOM); context.layout(); } } } }); }