auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Map<String, TestRunSink> testRunTopology(Topology topology, String configJson) throws Exception { TopologyDag dag = topologyDagBuilder.getDag(topology); topology.setTopologyDag(dag); ensureValid(dag); TopologyActions topologyActions = getTopologyActionsInstance(topology); LOG.debug("Running topology in test mode", topology); setUpClusterArtifacts(topology, topologyActions); String mavenArtifacts = setUpExtraJars(topology, topologyActions); ObjectMapper objectMapper = new ObjectMapper(); Map<String, List<Map<String, Object>>> testRecordsMap = objectMapper.readValue(configJson, new TypeReference<Map<String, List<Map<String, Object>>>>() {}); List<StreamlineSource> sources = dag.getOutputComponents().stream() .filter(c -> c instanceof StreamlineSource) .map(c -> (StreamlineSource) c) .collect(toList()); List<StreamlineSink> sinks = dag.getInputComponents().stream() .filter(c -> c instanceof StreamlineSink) .map(c -> (StreamlineSink) c) .collect(toList()); Map<String, TestRunSource> testRunSourceMap = sources.stream() .collect(toMap(s -> s.getName(), s -> new TestRunSource(s.getOutputStreams(), testRecordsMap.get(s.getName())))); Map<String, TestRunSink> testRunSinkMap = sinks.stream() .collect(toMap(s -> s.getName(), s -> { String uuid = UUID.randomUUID().toString(); return new TestRunSink(uuid, getTopologyTestRunResult(uuid)); })); TopologyLayout topologyLayout = CatalogToLayoutConverter.getTopologyLayout(topology, dag); topologyActions.testRun(topologyLayout, mavenArtifacts, testRunSourceMap, testRunSinkMap); return testRunSinkMap; }

Target:
public Map<String, TestRunSink> testRunTopology(Topology topology, String configJson) throws Exception { TopologyDag dag = topologyDagBuilder.getDag(topology); topology.setTopologyDag(dag); ensureValid(dag); TopologyActions topologyActions = getTopologyActionsInstance(topology); LOG.debug("Running topology in test mode", topology); setUpClusterArtifacts(topology, topologyActions); String mavenArtifacts = setUpExtraJars(topology, topologyActions); ObjectMapper objectMapper = new ObjectMapper(); Map<String, Map<String, List<Map<String, Object>>>> testRecordsForEachSource = objectMapper.readValue(configJson, new TypeReference<Map<String, Map<String, List<Map<String, Object>>>>>() {}); List<StreamlineSource> sources = dag.getOutputComponents().stream() .filter(c -> c instanceof StreamlineSource) .map(c -> (StreamlineSource) c) .collect(toList()); List<StreamlineSink> sinks = dag.getInputComponents().stream() .filter(c -> c instanceof StreamlineSink) .map(c -> (StreamlineSink) c) .collect(toList()); Map<String, TestRunSource> testRunSourceMap = sources.stream() .collect(toMap(s -> s.getName(), s -> new TestRunSource(s.getOutputStreams(), testRecordsForEachSource.get(s.getName())))); Map<String, TestRunSink> testRunSinkMap = sinks.stream() .collect(toMap(s -> s.getName(), s -> { String uuid = UUID.randomUUID().toString(); return new TestRunSink(uuid, getTopologyTestRunResult(uuid)); })); TopologyLayout topologyLayout = CatalogToLayoutConverter.getTopologyLayout(topology, dag); topologyActions.testRun(topologyLayout, mavenArtifacts, testRunSourceMap, testRunSinkMap); return testRunSinkMap; }
Source:
public String readline() throws IOException { String str = null; boolean done = false; boolean sawCarriage = false; while (!done) { if (offset >= buffer.length || end - offset <= 0) { offset = 0; end = 0; readAmount(DEFAULT_READ_COUNT); } int curIndex = offset; for (; !done && curIndex < end; curIndex++) { if (buffer[curIndex] == '\n') { sb.append(new String(buffer, offset, curIndex - offset)); int count = 0; if (sawCarriage) { count += 1; } str = sb.substring(0, Math.max(0, sb.length() - count)); offset = curIndex + 1; done = true; } else { sawCarriage = buffer[curIndex] == '\r'; } } if (!done) { sb.append(new String(buffer, offset, end - offset)); offset = end; } } sb.setLength(0); return str; }

Target:
public String readline() throws IOException { String str = null; boolean done = false; boolean sawCarriage = false; while (!done) { if (offset >= buffer.length || end - offset <= 0) { offset = 0; end = 0; readAmount(DEFAULT_READ_COUNT); } int curIndex = offset; for (; !done && curIndex < end; curIndex++) { if (buffer[curIndex] == '\n') { sb.append(buffer, offset, curIndex - offset); int count = 0; if (sawCarriage) { count += 1; } str = sb.substring(0, Math.max(0, sb.length() - count)); offset = curIndex + 1; done = true; } else { sawCarriage = buffer[curIndex] == '\r'; } } if (!done) { sb.append(buffer, offset, end - offset); offset = end; } } sb.setLength(0); return str; }
Source:
private void addObjectInstrumentation(BytecodeInstruction instruction, InsnList instrumentation, MethodNode mn) { if(instruction.isLocalVariableDefinition()) { if(instruction.getASMNode().getOpcode() == Opcodes.ALOAD) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else { instrumentation.add(new InsnNode(Opcodes.ACONST_NULL)); } } else if(instruction.isLocalVariableUse()){ if(instruction.getASMNode().getOpcode() == Opcodes.ASTORE) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else { instrumentation.add(new InsnNode(Opcodes.ACONST_NULL)); } } else if(instruction.isArrayStoreInstruction()) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else if(instruction.isFieldNodeDU()) { Type type = Type.getType(instruction.getFieldType()); if(type.getSort() == Type.OBJECT) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else { instrumentation.add(new InsnNode(Opcodes.ACONST_NULL)); } } else if(instruction.isMethodCall()) { Type type = Type.getReturnType(instruction.getMethodCallDescriptor()); if(type.getSort() == Type.OBJECT) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else { instrumentation.add(new InsnNode(Opcodes.ACONST_NULL)); } } }

Target:
private void addObjectInstrumentation(BytecodeInstruction instruction, InsnList instrumentation, MethodNode mn) { if(instruction.isLocalVariableDefinition()) { if(instruction.getASMNode().getOpcode() == Opcodes.ALOAD) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else { instrumentation.add(new InsnNode(Opcodes.ACONST_NULL)); } } else if(instruction.isLocalVariableUse()){ if(instruction.getASMNode().getOpcode() == Opcodes.ASTORE) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else { instrumentation.add(new InsnNode(Opcodes.ACONST_NULL)); } } else if(instruction.isArrayStoreInstruction()) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else if(instruction.isArrayLoadInstruction()) { instrumentation.add(new InsnNode(Opcodes.ACONST_NULL)); } else if(instruction.isFieldNodeDU()) { Type type = Type.getType(instruction.getFieldType()); if(type.getSort() == Type.OBJECT) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else { instrumentation.add(new InsnNode(Opcodes.ACONST_NULL)); } } else if(instruction.isMethodCall()) { Type type = Type.getReturnType(instruction.getMethodCallDescriptor()); if(type.getSort() == Type.OBJECT) { instrumentation.add(new InsnNode(Opcodes.DUP)); } else { instrumentation.add(new InsnNode(Opcodes.ACONST_NULL)); } } else { assert false : "Unknown instruction"; } }
Source:
public List<Pool> createPoolsForSubscription(Subscription sub) { return createPoolsForSubscription(sub, new ArrayList<Pool>()); }

Target:
public List<Pool> createPoolsForSubscription(Subscription sub) { return createPoolsForSubscription(sub, new LinkedList<Pool>()); }
Source:
private void processPropertiesXml(File file, AppInfo app) { DTConfiguration config = new DTConfiguration(); try { config.loadFile(file); for (Map.Entry<String, ValueEntry> entry : config.getMap().entrySet()) { String key = entry.getKey(); ValueEntry valueEntry = entry.getValue(); LOG.info("Properties: {}", key, valueEntry.value, valueEntry.description); if (valueEntry.value == null) { if (app == null) { requiredProperties.add(key); } else { app.requiredProperties.add(key); } } else { if (app == null) { defaultProperties.put(key, valueEntry); } else { app.requiredProperties.remove(key); app.defaultProperties.put(key, valueEntry); } } } } catch (Exception ex) { LOG.warn("Ignoring META_INF/properties.xml because of error", ex); } }

Target:
private void processPropertiesXml(File file, AppInfo app) { DTConfiguration config = new DTConfiguration(); try { config.loadFile(file); for (Map.Entry<String, String> entry : config) { String key = entry.getKey(); String value = entry.getValue(); if (value == null) { if (app == null) { requiredProperties.add(key); } else { app.requiredProperties.add(key); } } else { String description = key.contains(".attr.") ? null : config.getDescription(key); PropertyInfo propertyInfo = new PropertyInfo(value, description); if (app == null) { defaultProperties.put(key, propertyInfo); } else { app.requiredProperties.remove(key); app.defaultProperties.put(key, propertyInfo); } } } } catch (Exception ex) { LOG.warn("Ignoring META_INF/properties.xml because of error", ex); } }
Source:
private HiveAuthorizationTranslator getAuthorizationTranslator(HiveAuthorizer authorizer) { if(authorizer.getHiveAuthorizationTranslator() == null) { return defaultAuthorizationTranslator ; } }

Target:
private HiveAuthorizationTranslator getAuthorizationTranslator(HiveAuthorizer authorizer) throws HiveAuthzPluginException { if (authorizer.getHiveAuthorizationTranslator() == null) { return defaultAuthorizationTranslator; } else { return (HiveAuthorizationTranslator)authorizer.getHiveAuthorizationTranslator(); } }
Source:
public void read(BitBuffer input) throws CTFReaderException { currentField = tagDefinition.getValue(); Definition field = definitions.get(currentField); if( field == null ) { throw new CTFReaderException("Variant was not defined for "+ currentField); } field.read(input); }

Target:
public void read(BitBuffer input) throws CTFReaderException { currentField = tagDefinition.getValue(); Definition field = definitions.get(currentField); if (field == null) { throw new CTFReaderException("Variant was not defined for: "+ currentField); } field.read(input); }
Source:
public Flux<AmqpEndpointState> getEndpointStates() { return connectionStates; }

Target:
public Flux<AmqpEndpointState> getEndpointStates() { return endpointStates; }
Source:
private static String toJson(String source) { Map<String, String> queryPairs; try { queryPairs = gson.<Map<String, String>>fromJson(source, Map.class); } catch (JsonSyntaxException notJsonException) { queryPairs = new HashMap<>(); Map<String, String> pairsToFill = queryPairs; Arrays.stream(source.split("&")) .forEach( p -> { int delimiterIndex = p.indexOf("="); pairsToFill.put(p.substring(0, delimiterIndex), p.substring(delimiterIndex + 1)); }); } return gson.toJson(queryPairs); }

Target:
private static String toJson(String source) { if (source == null) { return null; } try { gson.<Map<String, String>>fromJson(source, Map.class); return source; } catch (JsonSyntaxException notJsonException) { Map<String, String> queryPairs = new HashMap<>(); Arrays.stream(source.split("&")) .forEach( p -> { int delimiterIndex = p.indexOf("="); queryPairs.put(p.substring(0, delimiterIndex), p.substring(delimiterIndex + 1)); }); return gson.toJson(queryPairs); } }
Source:
public HttpConnectionInterceptorContext interceptResponse(HttpConnectionInterceptorContext context) { if (shouldAttemptCookieRequest.get()) { HttpURLConnection connection = context.connection.getConnection(); try { boolean renewCookie = false; int statusCode = connection.getResponseCode(); if (statusCode == HttpURLConnection.HTTP_FORBIDDEN || statusCode == HttpURLConnection.HTTP_UNAUTHORIZED) { InputStream errorStream = connection.getErrorStream(); try { switch (statusCode) { case HttpURLConnection.HTTP_FORBIDDEN: String errorString = IOUtils.toString(errorStream, "UTF-8"); if (!errorString.matches("(?siu)" + ".*\\\"error\\\"\\s*:\\s*\\\"credentials_expired\\\".*")) { HttpConnectionInterceptorException toThrow = new HttpConnectionInterceptorException(errorString); toThrow.deserialize = true; throw toThrow; } else { renewCookie = true; } break; case HttpURLConnection.HTTP_UNAUTHORIZED: IOUtils.toString(errorStream, "UTF-8"); renewCookie = true; break; default: break; } } finally { IOUtils.closeQuietly(errorStream); } if (renewCookie) { logger.finest("Cookie was invalid attempt to get new cookie."); boolean success = requestCookie(connection.getURL(), context); if (success) { context.replayRequest = true; } else { context.replayRequest = false; shouldAttemptCookieRequest.set(false); } } } else { storeCookiesFromResponse(connection); } } catch (IOException e) { logger.log(Level.SEVERE, "Failed to get response code from request", e); } } return context; }

Target:
public HttpConnectionInterceptorContext interceptResponse(HttpConnectionInterceptorContext context) { if (shouldAttemptCookieRequest.get()) { HttpURLConnection connection = context.connection.getConnection(); try { boolean renewCookie = false; int statusCode = connection.getResponseCode(); if (statusCode == HttpURLConnection.HTTP_FORBIDDEN || statusCode == HttpURLConnection.HTTP_UNAUTHORIZED) { InputStream errorStream = connection.getErrorStream(); try { String errorString = IOUtils.toString(errorStream, "UTF-8"); logger.log(Level.FINE, String.format(Locale.ENGLISH, "Intercepted " + "response %d %s", statusCode, errorString)); switch (statusCode) { case HttpURLConnection.HTTP_FORBIDDEN: if (!errorString.matches("(?siu)" + ".*\\\"error\\\"\\s*:\\s*\\\"credentials_expired\\\".*")) { HttpConnectionInterceptorException toThrow = new HttpConnectionInterceptorException(errorString); toThrow.deserialize = true; throw toThrow; } else { renewCookie = true; } break; case HttpURLConnection.HTTP_UNAUTHORIZED: renewCookie = true; break; default: break; } } finally { IOUtils.closeQuietly(errorStream); } if (renewCookie) { logger.finest("Cookie was invalid attempt to get new cookie."); boolean success = requestCookie(connection.getURL(), context); if (success) { context.replayRequest = true; } else { context.replayRequest = false; shouldAttemptCookieRequest.set(false); } } } else { storeCookiesFromResponse(connection); } } catch (IOException e) { logger.log(Level.SEVERE, "Error reading response code or body from request", e); } } return context; }
Source:
public ClusterFeature get() { Set<AdditionalFeature> addlFeatures = BackendClusterFeatureHelper.getClusterFeatures(this, version); AdditionalFeature feature = addlFeatures.stream() .filter(f -> f.getId().equals(asGuid(id))) .findFirst() .orElseThrow(() -> new WebApplicationException(Response.Status.NOT_FOUND)); return addLinks(ClusterFeaturesMapper.map(feature, null)); }

Target:
public ClusterFeature get() { AdditionalFeature feature = BackendClusterFeatureHelper.getClusterFeature(this, version, guid); if (feature == null) { throw new WebApplicationException(Response.Status.NOT_FOUND); } return addLinks(map(feature, null)); }
Source:
public static File getFile(Object source, String filename) throws IOException { Class<?> clazz = (source instanceof Class<?>) ? (Class<?>) source : source.getClass(); if (Platform.isRunning()) { ClassLoader classLoader = clazz.getClassLoader(); if (classLoader.getClass().getName().equals("org.eclipse.osgi.internal.loader.ModuleClassLoader")) { return getFileFromClassLoader4Luna(filename, classLoader); } else if (classLoader.getClass() .getName() .equals("org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader")) { return getFileFromClassLoaderBeforeLuna(filename, classLoader); } } else { URL localURL = clazz.getResource(""); String path = URLDecoder.decode(localURL.getFile(), Charset.defaultCharset().name()); int i = path.indexOf("!"); if (i != -1) { int j = path.lastIndexOf(File.separatorChar, i); if (j != -1) { path = path.substring(0, j) + File.separator; } else { throw new AssertionFailedError("Unable to determine location for '" + filename + "' at '" + path + "'"); } if (path.startsWith("file:")) { path = path.substring(5); } return new File(path + filename); } else { String directory = clazz.getName().replaceAll("[^.]", ""); directory = directory.replaceAll(".", "../"); if (path.contains("/bin/")) { directory += "../"; } else if (path.contains("/target/classes/")) { directory += "../../"; } filename = path + (directory + filename).replaceAll("/", Matcher.quoteReplacement(File.separator)); return new File(filename).getCanonicalFile(); } } return null; }

Target:
public static File getFile(Object source, String filename) throws IOException { Class<?> clazz = (source instanceof Class<?>) ? (Class<?>) source : source.getClass(); if (Platform.isRunning()) { ClassLoader classLoader = clazz.getClassLoader(); if (isOsgiVersion310orNewer(classLoader)) { return getFileFromClassLoader4Luna(filename, classLoader); } else if (isOsgiVersion39orOlder(classLoader)) { return getFileFromClassLoaderBeforeLuna(filename, classLoader); } } else { return getFileFromNotRunningPlatform(filename, clazz); } return null; }
Source:
public Boolean insertSingleStat(final AggStats aggStats) { try { final List<AggStats> aggStatsList = Lists.newArrayList(aggStats); final int numSuccess = batchInsert(aggStatsList); if (numSuccess > 0) { LOGGER.debug(""); return Boolean.TRUE; } } catch (AmazonServiceException ase) { LOGGER.error(""); } return Boolean.FALSE; }

Target:
public Boolean insertSingleStat(final AggStats aggStats) { try { final List<AggStats> aggStatsList = Lists.newArrayList(aggStats); final int numSuccess = batchInsert(aggStatsList); if (numSuccess <= 0) { LOGGER.error("action=fail-aggstat-insert agg_stats={}", aggStats.toString()); return Boolean.FALSE; } return Boolean.TRUE; } catch (AmazonServiceException ase) { LOGGER.error("action=fail-aggstat-insert exception={} agg_stats={}", ase.getMessage(), aggStats.toString()); } return Boolean.FALSE; }
Source:
public @Nullable T resolve(ITmfEvent event) { for (ITmfEventAspect<?> aspect : fAspects) { Object resolve = aspect.resolve(event); if (resolve != null && resolve.getClass().isAssignableFrom(fClazz.getClass())) { return (T) resolve; } } return null; }

Target:
public @Nullable T resolve(ITmfEvent event) { for (ITmfEventAspect<?> aspect : fAspects) { Object resolve = aspect.resolve(event); if (resolve != null) { return (T) resolve; } } return null; }
Source:
private void updateConnectButton() { connectButton.setEnabled(Stream.of( urlValidator.isValid(), usernameValidator.isValid(), passwordValidator.isValid(), usernameAndPasswordValidator.isValid() ).reduce(true, Boolean::logicalAnd)); }

Target:
private void updateConnectButton() { connectButton.setEnabled(urlValidator.isValid() && usernameValidator.isValid() && passwordValidator.isValid() && usernameAndPasswordValidator.isValid()); }
Source:
public PersonListItem(Person person) { if (person != null) { personId = person.getPersonId(); uuid = person.getUuid(); boolean first = true; for (PersonName pn : person.getNames()) { if (first) { familyName = pn.getFamilyName(); middleName = pn.getMiddleName(); givenName = pn.getGivenName(); first = false; } else { if (!StringUtils.isBlank(otherNames)) otherNames += ","; otherNames += " " + pn.getGivenName() + " " + pn.getMiddleName() + " " + pn.getFamilyName(); } } gender = person.getGender(); birthdate = person.getBirthdate(); birthdateString = Format.format(person.getBirthdate()); birthdateEstimated = person.isBirthdateEstimated(); age = person.getAge(); voided = person.isPersonVoided(); if (person.getDeathDate() != null) { this.deathDateString = Format.format(person.getDeathDate()); } deathdateEstimated = person.isDeathdateEstimated(); for (PersonAttribute attribute : person.getActiveAttributes()) { attributes.put(attribute.getAttributeType().getName(), attribute.toString()); } } }

Target:
public PersonListItem(Person person) { if (person != null) { personId = person.getPersonId(); uuid = person.getUuid(); boolean first = true; for (PersonName pn : person.getNames()) { if (first) { familyName = pn.getFamilyName(); middleName = pn.getMiddleName(); givenName = pn.getGivenName(); first = false; } else { if (!StringUtils.isBlank(otherNames)) otherNames += ","; otherNames += " " + pn.getGivenName() + " " + pn.getMiddleName() + " " + pn.getFamilyName(); } } gender = person.getGender(); birthdate = person.getBirthdate(); birthdateString = Format.format(person.getBirthdate()); birthdateEstimated = person.isBirthdateEstimated(); age = person.getAge(); voided = person.isPersonVoided(); if (person.getDeathDate() != null) { this.deathDateString = Format.format(person.getDeathDate()); } deathdateEstimated = person.getDeathdateEstimated(); for (PersonAttribute attribute : person.getActiveAttributes()) { attributes.put(attribute.getAttributeType().getName(), attribute.toString()); } } }
Source:
public void addMembership(CohortMembership cohortMembership) { getMembers().add(cohortMembership); }

Target:
public void addMembership(CohortMembership cohortMembership) { if (!this.contains(cohortMembership.getPatient().getPatientId())) { cohortMembership.setCohort(this); getMembers().add(cohortMembership); } }
Source:
public Optional<Entity> spawnEntity(Entity entity) { return this.getExtent().spawnEntity(entity); }

Target:
public boolean spawnEntity(Entity entity) { return this.getExtent().spawnEntity(entity); }
Source:
public void reconfigure(HashMap<String, Object> params) throws RCException { if (storageManagerPreferences == null) { storageManagerPreferences = new StorageManagerPreferences(this); } HashMap<String, Object> caschedParams = (HashMap<String, Object>)storageManagerPreferences.getAllEntries(); caschedParams.putAll(params); RCUtils.validateSettingsParms(caschedParams); this.parameters = JainSipConfiguration.mergeParameters(this.parameters, caschedParams); StorageUtils.saveParams(storageManagerPreferences, parameters); signalingClient.reconfigure(params); registerForPushNotifications(true); }

Target:
public void reconfigure(HashMap<String, Object> params) throws RCException { if (storageManagerPreferences == null) { storageManagerPreferences = new StorageManagerPreferences(this); } HashMap<String, Object> cachedParams = (HashMap<String, Object>)storageManagerPreferences.getAllEntries(); cachedParams.putAll(params); RCUtils.validateSettingsParms(cachedParams); this.parameters = JainSipConfiguration.mergeParameters(params, cachedParams); StorageUtils.saveParams(storageManagerPreferences, parameters); signalingClient.reconfigure(params); registerForPushNotifications(true); }
Source:
public boolean canPushMerges() { if (this.canPerform(Permission.PUSH_MERGE) && canWrite()) { return true; } else if (projectControl.controlForRef(MagicBranch.NEW_CHANGE + getRefName()) .canPerform(Permission.PUSH_MERGE) && canWrite()) { return true; } return false; }

Target:
public boolean canPushMerges() { if (canPerform(Permission.PUSH_MERGE) && canWrite()) { return true; } else if (projectControl.controlForRef(MagicBranch.NEW_CHANGE + getRefName()) .canPerform(Permission.PUSH_MERGE) && canWrite()) { return true; } return false; }
Source:
public static @NonNull List<MarkerSet> getMarkerSets() { if (!MARKER_CONFIG_FILE.exists()) { return Collections.emptyList(); } List<MarkerSet> set = new ArrayList<>(parse(MARKER_CONFIG_FILE.getAbsolutePath())); Collection<String> extensionPoint = getExtensionDefinitionsPaths(); for (String extensionBookmark : extensionPoint) { set.addAll(parse(extensionBookmark)); } return set; }

Target:
public static @NonNull List<MarkerSet> getMarkerSets() { List<MarkerSet> markers = new ArrayList<>(); if (MARKER_CONFIG_FILE.exists()) { markers.addAll(parse(MARKER_CONFIG_FILE.getAbsolutePath())); } for (String extensionBookmark : getExtensionDefinitionsPaths()) { markers.addAll(parse(extensionBookmark)); } return markers; }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.welcome); mWelcomeView = (TextView) findViewById(R.id.welcome); String welcome = getString(R.string.welcome, getHotelName()); mWelcomeView.setText(welcome); mEnterButton = (Button) findViewById(R.id.enter_button); mEnterButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View arg0) { finish(); } }); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.welcome); View welcomeLayout = findViewById(R.id.layout_welcome); welcomeLayout.getBackground().setAlpha(BACKGROUND_ALPHA); TextView hotelName = (TextView) findViewById(R.id.hotel_name); hotelName.setText(getHotelName()); Button enterButton = (Button) findViewById(R.id.enter_button); enterButton.setOnClickListener(new View.OnClickListener() { public void onClick(View arg0) { finish(); } }); }
Source:
protected void onPushReceive(Context context, Intent intent) { try { CourseUpdateNotificationPayload payload = ParseHandleHelper.extractPayload(intent); if (payload != null && ParseHandleHelper.hasNotificationHash(context, payload.getIdentifier())) return; if (enableFlyinWindow) { Intent intent2 = new Intent(context, NotificationFlyinService.class); intent2.putExtra("com.parse.Data", intent.getExtras().getString("com.parse.Data")); context.startService(intent2); } } catch (Exception ex) { logger.debug(ex.toString()); } super.onPushReceive(context, intent); }

Target:
protected void onPushReceive(Context context, Intent intent) { BaseNotificationPayload payload = ParseHandleHelper.extractPayload(intent); if (payload != null && ParseHandleHelper.hasNotificationHash(context, payload.getIdentifier())) return; super.onPushReceive(context, intent); }
Source:
public static void update(Context context) { class ScanReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { if (Intent.ACTION_MEDIA_SCANNER_FINISHED.equals(intent.getAction())) { context.unregisterReceiver(this); Toast.makeText(context, R.string.scan_index_updated, Toast.LENGTH_SHORT).show(); } else { Toast.makeText(context, R.string.scan_updating_index, Toast.LENGTH_SHORT).show(); } } } IntentFilter filter = new IntentFilter(); filter.addDataScheme("file"); filter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED); filter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED); context.registerReceiver(new ScanReceiver(), filter); Bundle args = new Bundle(); args.putString("volume", "external"); Intent scannerIntent = new Intent("android.media.IMediaScannerService") .setClassName("com.android.providers.media", "com.android.providers.media.MediaScannerService") .putExtras(args); context.startService(scannerIntent); }

Target:
public static void update(Context context) { IntentFilter filter = new IntentFilter(); filter.addDataScheme("file"); filter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED); filter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED); context.registerReceiver(new ScanReceiver(), filter); Bundle args = new Bundle(); args.putString("volume", "external"); Intent scannerIntent = new Intent("android.media.IMediaScannerService") .setClassName("com.android.providers.media", "com.android.providers.media.MediaScannerService") .putExtras(args); context.startService(scannerIntent); }
Source:
public String getToolTipText(Object element) { ITaskReview review = (ITaskReview) element; StringBuilder sb = new StringBuilder(); sb.append("Description: "); sb.append(review.getSummary()); sb.append("\n"); sb.append("Verified: "); if (review.getV() >= 1) { sb.append("YES"); } else { sb.append("NO"); } sb.append("\n"); sb.append("Code Review: "); sb.append(review.getCr()); return sb.toString(); }

Target:
public String getToolTipText(Object element) { TaskReview review = (TaskReview) element; StringBuilder sb = new StringBuilder(); sb.append("Description: "); sb.append(review.getSummary()); sb.append("\n"); sb.append("Verified: "); if (review.getV() >= 1) { sb.append("YES"); } else { sb.append("NO"); } sb.append("\n"); sb.append("Code Review: "); sb.append(review.getCr()); return sb.toString(); }
Source:
public void sendInitialMessages(DisplayMode mode) { send(new RebuildNormalMessage(position, index, updateInfo, world.getPlayerRepository(), world.getRegionRepository().getXteaRepository(), false)); interfaceSet.openTop(mode); for (TopLevelPosition position : TopLevelPosition.values()) { if (position.getInterfaceId() == -1) { continue; } interfaceSet.openTopLevel(position); } sendMessage("Welcome to RuneScape."); if (isMuted()) { sendMessage("You are currently muted. Other players will not see your chat messages."); } updateAppearance(); send(new ConfigMessage(1737, 1 << 31)); inventory.forceRefresh(); equipment.forceRefresh(); bank.forceRefresh(); skillSet.forceRefresh(); world.submit(new LoginEvent(this)); }

Target:
public void sendInitialMessages(DisplayMode mode) { send(new RebuildNormalMessage(position, index, updateInfo, world.getPlayerRepository(), world.getRegionRepository().getXteaRepository(), false)); interfaceSet.openTop(mode); for (TopLevelPosition position : TopLevelPosition.values()) { if (position.getInterfaceId() == -1) { continue; } interfaceSet.openTopLevel(position); } sendMessage("Welcome to RuneScape."); if (isMuted()) { sendMessage("You are currently muted. Other players will not see your chat messages."); } updateAppearance(); send(new ConfigMessage(1737, 1 << 31)); send(new ChatFilterSettingsMessage(chatPrivacy, friendPrivacy)); send(new ChatFilterSettingsMessage(chatPrivacy, friendPrivacy)); inventory.forceRefresh(); equipment.forceRefresh(); bank.forceRefresh(); skillSet.forceRefresh(); world.submit(new LoginEvent(this)); }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = super.getPermissionCheckSubjects(); if (getParameters().getInterface().isPromisc()) { permissionList.add(new PermissionSubject(getVm().getstorage_pool_id(), VdcObjectType.StoragePool, ActionGroup.PROMISC)); } return permissionList; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { List<PermissionSubject> permissionList = super.getPermissionCheckSubjects(); if (getParameters().getInterface() != null && getVm() != null && getParameters().getInterface().isPromisc()) { permissionList.add(new PermissionSubject(getVm().getstorage_pool_id(), VdcObjectType.StoragePool, ActionGroup.PROMISC)); } return permissionList; }
Source:
public void assignAccessPoints() throws Exception { final List<Object> dto = Lists.<Object>newArrayList("apID1", "apID2", "apID3"); final List<ID> apIDs = Lists.newArrayList(new ID("apID1"), new ID("apID2"), new ID("apID3")); final ID operID = new ID("operID"); context.checking(new Expectations() {{ oneOf(repository).assignAccessPoints(with(matching(operID)) , with(matching(apIDs))); }}); Request request = makeRequestThatContains(dto); Reply<?> reply = service.assignAccessPoints("operID", request); assertThat(reply, isOk()); }

Target:
public void assignAccessPoints() throws Exception { final List<String> dto = Lists.newArrayList("apID1", "apID2", "apID3"); final List<ID> apIDs = Lists.newArrayList(new ID("apID1"), new ID("apID2"), new ID("apID3")); final ID operID = new ID("operID"); context.checking(new Expectations() {{ oneOf(repository).assignAccessPoints(with(matching(operID)) , with(matching(apIDs))); }}); Request request = makeRequestThatContains(dto); Reply<?> reply = service.assignAccessPoints("operID", request); assertThat(reply, isOk()); }
Source:
protected StorageFileItem retrieveFromRemoteIfExists( final MavenProxyRepository mavenProxyRepository, final String path ) throws IOException { final ResourceStoreRequest request = new ResourceStoreRequest( path ); request.setRequestRemoteOnly( true ); request.getRequestContext().put( Manager.ROUTING_INITIATED_FILE_OPERATION_FLAG_KEY, Boolean.TRUE ); if ( ChecksumPolicy.STRICT == mavenProxyRepository.getChecksumPolicy() ) { request.getRequestContext().put( ChecksumPolicy.REQUEST_CHECKSUM_POLICY_KEY, ChecksumPolicy.STRICT_IF_EXISTS ); } final boolean presentRemotely = mavenProxyRepository.getRemoteStorage().containsItem( mavenProxyRepository, request ); if ( !presentRemotely ) { return null; } mavenProxyRepository.removeFromNotFoundCache( request ); try { @SuppressWarnings( "deprecation" ) final StorageItem item = mavenProxyRepository.retrieveItem( true, request ); if ( item instanceof StorageFileItem ) { return (StorageFileItem) item; } else { return null; } } catch ( IllegalOperationException e ) { return null; } catch ( ItemNotFoundException e ) { mavenProxyRepository.removeFromNotFoundCache( request ); return null; } }

Target:
protected StorageFileItem retrieveFromRemoteIfExists( final MavenProxyRepository mavenProxyRepository, final String path ) throws IOException { final ResourceStoreRequest request = new ResourceStoreRequest( path ); request.setRequestRemoteOnly( true ); request.getRequestContext().put( Manager.ROUTING_INITIATED_FILE_OPERATION_FLAG_KEY, Boolean.TRUE ); request.getRequestContext().put( ChecksumPolicy.REQUEST_CHECKSUM_POLICY_KEY, ChecksumPolicy.IGNORE ); final boolean presentRemotely = mavenProxyRepository.getRemoteStorage().containsItem( mavenProxyRepository, request ); if ( !presentRemotely ) { return null; } mavenProxyRepository.removeFromNotFoundCache( request ); try { @SuppressWarnings( "deprecation" ) final StorageItem item = mavenProxyRepository.retrieveItem( true, request ); if ( item instanceof StorageFileItem ) { return (StorageFileItem) item; } else { return null; } } catch ( IllegalOperationException e ) { return null; } catch ( ItemNotFoundException e ) { mavenProxyRepository.removeFromNotFoundCache( request ); return null; } }
Source:
public GsUploadManager(SecorConfig config) throws Exception { super(config); String credentialPath = System.getenv("GOOGLE_APPLICATION_CREDENTIALS"); if (credentialPath == null) { credentialPath = mConfig.getGsCredentialsPath(); } mClient = getService(credentialPath); }

Target:
public GsUploadManager(SecorConfig config) throws Exception { super(config); mClient = getService(mConfig.getGsCredentialsPath()); }
Source:
public void close() { Misc.free(writerPool); Misc.free(readerPool); if (null != backupWriterPool) { Misc.free(backupWriterPool); } }

Target:
public void close() { Misc.free(writerPool); Misc.free(readerPool); }
Source:
public CompletableFuture<Void> prepareSnapshot( ChannelStateWriter channelStateWriter, long checkpointId) throws IOException { throw new UnsupportedOperationException("Checkpoints are not supported for sorting inputs"); }

Target:
public CompletableFuture<Void> prepareSnapshot( ChannelStateWriter channelStateWriter, long checkpointId) { throw new UnsupportedOperationException("Checkpoints are not supported for sorting inputs"); }
Source:
private void fetchUsersForCurrentMapPosition() { if (mLastPosition.zoom < getResources().getInteger(R.integer.map_zoom_min_load)) { sendMessage(R.string.users_dont_load); } else { sendMessage(R.string.loading_users); getResumePauseDisposable().add( mUserRepository.searchByLocation(mMap.getBoundingBox()) .observeOn(AndroidSchedulers.mainThread()) .filter(list -> !list.isEmpty()) .subscribe(searchResult -> { for (UserSearchByLocationResponse.User user : searchResult) { addUserToCluster(user.toSimpleUser()); } mMarkerClusterer.invalidate(); mMap.invalidate(); }, throwable -> { Log.e(TAG, throwable.getMessage()); })); } }

Target:
private void fetchUsersForCurrentMapPosition() { if (mLastPosition.zoom < mMapZoomMinLoad) { sendMessage(R.string.users_dont_load); } else { mProgressLoadingUsers.setVisibility(View.VISIBLE); getResumePauseDisposable().add( mUserRegionalCache.searchByLocation(mMap.getBoundingBox()) .observeOn(AndroidSchedulers.mainThread()) .doFinally(() -> mProgressLoadingUsers.setVisibility(View.GONE)) .filter(searchResult -> !searchResult.isEmpty()) .subscribe(searchResult -> { for (UserSearchByLocationResponse.User user : searchResult) { addUserToCluster(user.toSimpleUser()); } mMarkerClusterer.invalidate(); mMap.invalidate(); }, throwable -> { Log.e(TAG, throwable.getMessage()); sendMessage(R.string.http_server_access_failure); })); } }
Source:
public Statement apply(Statement base, Description description) { if (isDebugging() && !fEnableWhenDebugging) { return base; } return new FailOnTimeout(base, fTimeout, fTimeUnit, fLookForStuckThread); }

Target:
public Statement apply(Statement base, Description description) { if (!enableWhenDebugging && isDebugging()) { return new FailOnTimeout(base, 0, timeUnit, lookForStuckThread); } return new FailOnTimeout(base, timeout, timeUnit, lookForStuckThread); }
Source:
public boolean updateVolumeId(long srcVolId, long destVolId) { TransactionLegacy txn = TransactionLegacy.currentTxn(); try { VolumeDataStoreVO volumeDataStoreVO = findByVolume(srcVolId); if(volumeDataStoreVO != null) { txn.start(); volumeDataStoreVO.setVolumeId(destVolId); update(volumeDataStoreVO.getId(), volumeDataStoreVO); txn.commit(); } } catch (Exception e) { throw new CloudRuntimeException("Unable to update the volume id for volume store ref"); } return true; }

Target:
public boolean updateVolumeId(long srcVolId, long destVolId) { TransactionLegacy txn = TransactionLegacy.currentTxn(); try { VolumeDataStoreVO volumeDataStoreVO = findByVolume(srcVolId); if(volumeDataStoreVO != null) { txn.start(); volumeDataStoreVO.setVolumeId(destVolId); update(volumeDataStoreVO.getId(), volumeDataStoreVO); txn.commit(); } } catch (Exception e) { throw new CloudRuntimeException("Unable to update the volume id for volume store ref", e); } return true; }
Source:
public PopupMenuAddFormhandlerParam() { super(Constant.messages.getString("formhandler.popup.menu.params.add.label")); this.addActionListener(new java.awt.event.ActionListener() { @Override public void actionPerformed(java.awt.event.ActionEvent e) { HtmlParameterStats hps = ((ParamsTableModel) paramTable.getModel()).getHtmlParameterStatsAtRow(paramTable.getSelectedRow()); popupDialogAddField = new PopupDialogAddField(View.getSingleton().getOptionsDialog(null), hps.getName(), hps.getValuesSummary().split(",")); popupDialogAddField.setVisible(true); } }); }

Target:
public PopupMenuAddFormhandlerParam() { super(Constant.messages.getString("formhandler.popup.menu.params.add.label")); this.addActionListener(e -> { PopupDialogAddField popupDialogAddField = null; HtmlParameterStats hps = ((ParamsTableModel) paramTable.getModel()) .getHtmlParameterStatsAtRow(paramTable.getSelectedRow()); popupDialogAddField = new PopupDialogAddField(View.getSingleton().getOptionsDialog(null), hps.getName(), hps.getValues()); popupDialogAddField.setVisible(true); }); }
Source:
public String getWholeText(){ final StringBuilder accum = new StringBuilder(); new NodeTraversor(new NodeVisitor() { public void head(Node node, int depth) { if (node instanceof TextNode) { TextNode textNode = (TextNode) node; accum.append(textNode.getWholeText()); } } public void tail(Node node, int depth) { } }).traverse(this); return accum.toString().trim(); }

Target:
public String getWholeText(){ final StringBuilder accum = new StringBuilder(); new NodeTraversor(new NodeVisitor() { public void head(Node node, int depth) { if (node instanceof TextNode) { TextNode textNode = (TextNode) node; accum.append(textNode.getWholeText()); } } public void tail(Node node, int depth) { } }).traverse(this); return accum.toString(); }
Source:
protected Map<String, String> getPersistenceProperties(KieServerConfig config) { Map<String, String> persistenceProperties = new HashMap<String, String>(); persistenceProperties.put("hibernate.dialect", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_DIALECT, "org.hibernate.dialect.H2Dialect")); persistenceProperties.put("hibernate.default_schema", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_DEFAULT_SCHEMA)); persistenceProperties.put("hibernate.transaction.jta.platform", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_TM, "org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform")); persistenceProperties.put("javax.persistence.jtaDataSource", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_DS, "java:jboss/datasources/ExampleDS")); System.getProperties().stringPropertyNames() .stream() .filter(name -> name.startsWith("hibernate.") || name.startsWith("javax.persistence")) .forEach(name -> persistenceProperties.put(name, System.getProperty(name))); return persistenceProperties; }

Target:
protected Map<String, String> getPersistenceProperties(KieServerConfig config) { Map<String, String> persistenceProperties = new HashMap<String, String>(); persistenceProperties.put("hibernate.dialect", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_DIALECT, "org.hibernate.dialect.H2Dialect")); persistenceProperties.put("hibernate.default_schema", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_DEFAULT_SCHEMA)); persistenceProperties.put("hibernate.transaction.jta.platform", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_TM, "org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform")); persistenceProperties.put("javax.persistence.jtaDataSource", config.getConfigItemValue(KieServerConstants.CFG_PERSISTANCE_DS, "java:jboss/datasources/ExampleDS")); System.getProperties().stringPropertyNames() .stream() .filter(PersistenceUnitInfoLoader::isValidPersistenceKey) .forEach(name -> persistenceProperties.put(name, System.getProperty(name))); return persistenceProperties; }
Source:
public void flush() { }

Target:
public void flush() { for (ExtensionProxy extension : getExtensions()) { extension.invoke(new ExtMap() .mput(Base.InvokeKeys.COMMAND, Logger.InvokeCommands.FLUSH)); } }
Source:
protected Response performAction(VdcActionType task, VdcActionParametersBase params, Action action) { try { if (QueryHelper.hasMatrixParam(getUriInfo(), ASYNC_CONSTRAINT) || expectNonBlocking()) { getCurrent().get(MetaData.class).set("async", true); return performNonBlockingAction(task, params); } else { doAction(task, params); if (action!=null) { action.setStatus(StatusUtils.create(CreationStatus.COMPLETE)); return Response.ok().entity(action).build(); } else { return Response.ok().build(); } } } catch (Exception e) { return handleError(Response.class, e, false); } }

Target:
protected Response performAction(VdcActionType task, VdcActionParametersBase params, Action action) { try { if (QueryHelper.hasMatrixParam(getUriInfo(), ASYNC_CONSTRAINT) || expectNonBlocking()) { getCurrent().get(MetaData.class).set("async", true); return performNonBlockingAction(task, params, action); } else { doAction(task, params); if (action!=null) { action.setStatus(StatusUtils.create(CreationStatus.COMPLETE)); return Response.ok().entity(action).build(); } else { return Response.ok().build(); } } } catch (Exception e) { return handleError(Response.class, e, false); } }
Source:
public void setWhiteListContexts(List<String> whiteListContexts) { if (whiteListContexts == null) { return; } for (String entry : whiteListContexts) { String[] split = entry.split("="); if (split.length == 2) { SYSTEM_PROTECTION_WHITELIST.add(split[0], split[1]); } } }

Target:
public void setWhiteListContexts(List<String> whiteListContexts) { if (whiteListContexts == null) { return; } SYSTEM_PROTECTION_WHITELIST.clear(); for (String entry : whiteListContexts) { String[] split = entry.split("="); if (split.length == 2) { Pattern existingPattern = SYSTEM_PROTECTION_WHITELIST .keySet() .stream() .filter(regex -> regex.toString().equals(split[0].trim())) .findFirst() .orElse(null); if (existingPattern == null) { existingPattern = Pattern.compile(split[0].trim()); } SYSTEM_PROTECTION_WHITELIST.add(existingPattern, split[1].trim()); } } }
Source:
private void initializeFromLocalSearch(LocalSearch search) { this.search = search; if (search.searchAllAccounts()) { List<Account> accounts = preferences.getAccounts(); singleAccountMode = (accounts.size() == 1); if (singleAccountMode) { account = accounts.get(0); } } else { String[] accountUuids = search.getAccountUuids(); singleAccountMode = (accountUuids.length == 1); if (singleAccountMode) { account = preferences.getAccount(accountUuids[0]); } } List<String> folderServerIds = search.getFolderServerIds(); singleFolderMode = singleAccountMode && folderServerIds.size() == 1; if (drawer == null) { return; } else if (singleFolderMode) { drawer.selectFolder(folderServerIds.get(0)); } else if (search.getId().equals(SearchAccount.UNIFIED_INBOX)) { drawer.selectUnifiedInbox(); } else { drawer.selectFolder(null); } actionBarSubTitle.setVisibility((!singleFolderMode) ? View.GONE : View.VISIBLE); }

Target:
private void initializeFromLocalSearch(LocalSearch search) { this.search = search; if (search.searchAllAccounts()) { List<Account> accounts = preferences.getAccounts(); singleAccountMode = (accounts.size() == 1); if (singleAccountMode) { account = accounts.get(0); } } else { String[] accountUuids = search.getAccountUuids(); singleAccountMode = (accountUuids.length == 1); if (singleAccountMode) { account = preferences.getAccount(accountUuids[0]); } } List<String> folderServerIds = search.getFolderServerIds(); singleFolderMode = singleAccountMode && folderServerIds.size() == 1; actionBarSubTitle.setVisibility((!singleFolderMode) ? View.GONE : View.VISIBLE); if (drawer == null) { return; } else if (singleFolderMode) { drawer.selectFolder(folderServerIds.get(0)); } else if (search.getId().equals(SearchAccount.UNIFIED_INBOX)) { drawer.selectUnifiedInbox(); } else { drawer.selectFolder(null); } }
Source:
long getHammingDistance() { IntPredicate areNotEqual = index -> leftStrand.charAt(index) != rightStrand.charAt(index); return IntStream.range(0, leftStrand.length()).filter(areNotEqual).count(); }

Target:
int getHammingDistance() { return hammingDistance; }
Source:
public StyledString buildTextFromEventIndex(int index, ITaskAttachment attachment) { StyledString text = new StyledString(); switch (index) { case 0: if (AttachmentUtil.isContext(attachment)) { text.append(Messages.AttachmentTableLabelProvider_Task_Context); } else if (attachment.isPatch()) { text.append(Messages.AttachmentTableLabelProvider_Patch); } else { text.append(" " + attachment.getFileName()); } break; case 1: if (attachment.getDescription() != null) { text.append(attachment.getDescription()); } break; case 2: Long length = attachment.getLength(); if (length < 0) { text.append("-"); } text.append(sizeFormatter.format(length)); break; case 3: String autherText = (attachment.getAuthor() != null) ? attachment.getAuthor().toString() : ""; String[] autherPart = autherText.split(" <"); text.append(autherPart[0] + " ", StyledString.COUNTER_STYLER); if (autherPart.length > 1) { text.append("<" + autherPart[1], StyledString.COUNTER_STYLER); } break; case 4: text.append((attachment.getCreationDate() != null) ? EditorUtil.formatDateTime(attachment.getCreationDate()) : ""); break; case 5: text.append(getAttachmentId(attachment)); break; default: text.append("unrecognized column"); break; } return text; }

Target:
public StyledString buildTextFromEventIndex(int index, ITaskAttachment attachment) { StyledString text = new StyledString(); switch (index) { case 0: if (AttachmentUtil.isContext(attachment)) { text.append(Messages.AttachmentTableLabelProvider_Task_Context); } else if (attachment.isPatch()) { text.append(Messages.AttachmentTableLabelProvider_Patch); } else { text.append(" " + attachment.getFileName()); } break; case 1: if (attachment.getDescription() != null) { text.append(attachment.getDescription()); } break; case 2: long length = attachment.getLength(); if (length < 0) { text.append("-"); } text.append(sizeFormatter.format(length)); break; case 3: String autherText = (attachment.getAuthor() != null) ? attachment.getAuthor().toString() : ""; String[] autherPart = autherText.split(" <"); text.append(autherPart[0] + " ", StyledString.COUNTER_STYLER); if (autherPart.length > 1) { text.append("<" + autherPart[1], StyledString.COUNTER_STYLER); } break; case 4: text.append((attachment.getCreationDate() != null) ? EditorUtil.formatDateTime(attachment.getCreationDate()) : ""); break; case 5: text.append(getAttachmentId(attachment)); break; default: text.append("unrecognized column"); break; } return text; }
Source:
public void setGetterName(String name) { Assert.isNotNull(fGetterName); fGetterName= name; fCreateGetter= !fGetterName.isEmpty(); }

Target:
public void setGetterName(String name) { Assert.isNotNull(name); fGetterName= name; fCreateGetter = !name.isEmpty(); }