Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

11
LINES

< > BotCompany Repo | #1034366 // cMigrateField

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (20163L/122K).

1  
svoid cMigrateField(Concept c, S oldField, S newField) {
2  
  if (c == null) ret;
3  
  O oldValue = cget(c, oldField);
4  
  O newValue = cget(c, newField);
5  
  if (oldValue != null && newValue == null) pcall {
6  
    S name = shortDynName(c);
7  
    print("Migrating " + name + "." + oldField + " -> " + name + "." + newField + " [id " + c.id + "]");
8  
    cset(c, newField, oldValue);
9  
    cset(c, oldField, null);
10  
  }
11  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034366
Snippet name: cMigrateField
Eternal ID of this version: #1034366/2
Text MD5: d3b72c973b3879f8b039285bc85920b2
Transpilation MD5: 27f78101c7b4cb618d604a24b6a909c7
Author: stefan
Category: javax / concepts
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-02-03 08:23:25
Source code size: 411 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 76 / 122
Version history: 1 change(s)
Referenced in: [show references]